Forum: Cfengine Help
Subject: Re: Advice on using package promises
Author: jgreer
Link to topic: https://cfengine.com/forum/read.php?3,22672,22679#msg-22679

Sure thing - built from rev 2498.

Changed packages policy to simply:

    
"wireshark-1.0.15"
      package_policy  => "addupdate",
      package_method  => yum_rpm_exact,
      package_select  => "==",
      action          => actionsettings_fix_inform("inform");



No changes to my package_method body.  

I believe that with working comparators, this should:

 - call 'package_add_command' if no package named wireshark is installed
 - call 'package_update_command' if no package named wireshark-1.0.15 is 
installed

Is that correct?


The behavior in trunk appears not to have changed - 'package_update_command' 
always fires.


Testing results:

#### wireshark < 1.0.15 is installed:

# yum list installed | grep wireshark
wireshark.x86_64                          1.0.11-1.el5_5.5             installed


# cf-agent -Kv 

cf3     .........................................................
cf3     Promise handle: 
cf3     Promise made by: wireshark-1.0.15
cf3     .........................................................
cf3 
cf3  ???????????????????????????????????????????????????????????????
cf3    Reading package list from /bin/rpm
cf3  ???????????????????????????????????????????????????????????????
cf3 # Software reporting feature is only available in version Nova and above
cf3 # Patch reporting feature is only available in version Nova and above
cf3  ???????????????????????????????????????????????????????????????
cf3   Done checking packages and patches
cf3  ???????????????????????????????????????????????????????????????
cf3  -> Package version specified implicitly in promiser's name
cf3  -> Looking for (wireshark,*,*)
cf3  -> Matched name wireshark
cf3  -> Matched version *
cf3  -> Looking for (wireshark,1.0.15,*)
cf3  -> Matched name wireshark
cf3  -> Check for compatible versioning model in (1.0.15,1.0.11)
cf3  -> Verified that versioning models are compatible
cf3  -> Verified version constraint promise kept
cf3  -> 1 package(s) matching the name "wireshark" already installed
cf3  -> 1 package(s) match the promise body's criteria fully
cf3  -> Package promises to refer to itself as "wireshark-1.0.15" to the manager
cf3  -> Package version seems to match criteria
cf3  -> Schedule package for update
cf3  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
cf3    Offering these package-promise suggestions to the managers
cf3  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
cf3  -> Deletion schedule...
cf3  -> Addition schedule...
cf3  -> Update schedule...
cf3 Execute scheduled package update
cf3 Command prefix: /usr/bin/yum -y update
cf3 Executing /usr/bin/yum -y update wireshark-1.0.15...
cf3 Q:yum -y update wiresh ...:Loaded plugins: downloadonly, rhnplugin, security
cf3 Q:yum -y update wiresh ...:Skipping security plugin, no data
cf3 Q:yum -y update wiresh ...:Setting up Update Process
cf3 Q:yum -y update wiresh ...:Resolving Dependencies
cf3 Q:yum -y update wiresh ...:Skipping security plugin, no data
cf3 Q:yum -y update wiresh ...:--> Running transaction check
cf3 Q:yum -y update wiresh ...:---> Package wireshark.x86_64 0:1.0.15-1.el5_6.4 
set to be updated
cf3 Q:yum -y update wiresh ...:--> Finished Dependency Resolution
cf3 Q:yum -y update wiresh ...:
cf3 Q:yum -y update wiresh ...:Dependencies Resolved
cf3 Q:yum -y update wiresh ...:
cf3 Q:yum -y update wiresh 
...:================================================================================
cf3 Q:yum -y update wiresh ...: Package         Arch         Version            
    Repository            Size
cf3 Q:yum -y update wiresh 
...:================================================================================
cf3 Q:yum -y update wiresh ...:Updating:
cf3 Q:yum -y update wiresh ...: wireshark       x86_64       1.0.15-1.el5_6.4   
    redhat-updates        12 M
cf3 Q:yum -y update wiresh ...:
cf3 Q:yum -y update wiresh ...:Transaction Summary
cf3 Q:yum -y update wiresh 
...:================================================================================
cf3 Q:yum -y update wiresh ...:Install       0 Package(s)
cf3 Q:yum -y update wiresh ...:Upgrade       1 Package(s)
cf3 Q:yum -y update wiresh ...:
cf3 Q:yum -y update wiresh ...:Total download size: 12 M
cf3 Q:yum -y update wiresh ...:Downloading Packages:
cf3 Q:yum -y update wiresh ...:Running rpm_check_debug
cf3 Q:yum -y update wiresh ...:Running Transaction Test
cf3 Q:yum -y update wiresh ...:Finished Transaction Test
cf3 Q:yum -y update wiresh ...:Transaction Test Succeeded
cf3 Q:yum -y update wiresh ...:Running Transaction
cf3 Q:yum -y update wiresh ...:^M  Updating       : wireshark                   
                             1/2
cf3 Q:yum -y update wiresh ...:^M  Cleanup        : wireshark                   
                             2/2
cf3 Q:yum -y update wiresh ...:
cf3 Q:yum -y update wiresh ...:Updated:
cf3 Q:yum -y update wiresh ...:  wireshark.x86_64 0:1.0.15-1.el5_6.4
cf3 Q:yum -y update wiresh ...:
cf3 Q:yum -y update wiresh ...:Complete!
cf3 Q:yum -y update wiresh ...:
cf3 Package schedule execution ok for wireshark-1.0.15 (outcome cannot be 
promised by cf-agent)
cf3  -> Patch schedule...
cf3  -> Verify schedule...
cf3 



#### wireshark  1.0.15 is installed:

cf3     .........................................................
cf3     Promise handle: 
cf3     Promise made by: wireshark-1.0.15
cf3     .........................................................
cf3 
cf3  ???????????????????????????????????????????????????????????????
cf3    Reading package list from /bin/rpm
cf3  ???????????????????????????????????????????????????????????????
cf3 # Software reporting feature is only available in version Nova and above
cf3 # Patch reporting feature is only available in version Nova and above
cf3  ???????????????????????????????????????????????????????????????
cf3   Done checking packages and patches
cf3  ???????????????????????????????????????????????????????????????
cf3  -> Package version specified implicitly in promiser's name
cf3  -> Looking for (wireshark,*,*)
cf3  -> Matched name wireshark
cf3  -> Matched version *
cf3  -> Looking for (wireshark,1.0.15,*)
cf3  -> Matched name wireshark
cf3  -> Check for compatible versioning model in (1.0.15,1.0.15)
cf3  -> Verified that versioning models are compatible
cf3  -> Verified version constraint promise kept
cf3  -> 1 package(s) matching the name "wireshark" already installed
cf3  -> 1 package(s) match the promise body's criteria fully
cf3  -> Package promises to refer to itself as "wireshark-1.0.15" to the manager
cf3  -> Package version seems to match criteria
cf3  -> Schedule package for update
cf3  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
cf3    Offering these package-promise suggestions to the managers
cf3  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
cf3  -> Deletion schedule...
cf3  -> Addition schedule...
cf3  -> Update schedule...
cf3 Execute scheduled package update
cf3 Command prefix: /usr/bin/yum -y update
cf3 Executing /usr/bin/yum -y update wireshark-1.0.15...
cf3 Q:yum -y update wiresh ...:Loaded plugins: downloadonly, rhnplugin, security
cf3 Q:yum -y update wiresh ...:Skipping security plugin, no data
cf3 Q:yum -y update wiresh ...:Setting up Update Process
cf3 Q:yum -y update wiresh ...:No Packages marked for Update
cf3 Q:yum -y update wiresh ...:
cf3 Package schedule execution ok for wireshark-1.0.15 (outcome cannot be 
promised by cf-agent)
cf3  -> Patch schedule...
cf3  -> Verify schedule...


-Jessica

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to