Method failed in some repairs, how to ignore this error?

240 views
Skip to first unread message

Andreas K

unread,
Sep 24, 2014, 12:35:55 AM9/24/14
to help-c...@googlegroups.com
Hello,

I want to use the "usebundle" statment to call another bundle (the name is "k_copy_m"). This bundle has some file promises, which might be unable to be repaired, because the source file does not exist. Cfengine is reporting an error in that case:

2014-09-24T06:20:17+0200    error: /default/getvar/methods/'any'[1]: Method 'k_copy_m' failed in some repairs

If I just use a file promise in a bundle to copy files, usually no error is reported if the file cannot be copied. It will just be skipped.

I do not want to receive this error when encapsulating the file promise in a bundle called by "usebundle".

Is there any approach or setting to avoid this behavior?

Thanks for any suggestions, Andreas.


Brian Bennett

unread,
Sep 24, 2014, 3:25:17 AM9/24/14
to Andreas K, help-c...@googlegroups.com
This will depend on the location of the source files. If the source files are local you can constrain the promise with ifvarclass => fileexists().

E.g.:

files:
  "/etc/motd"
    copy_from => cp("/tmp/motd")
    ifvarclass => fileexists("/tmp/motd");

Then the promise will only be evaluated if your source file exists.

I did some looking around the docs but didn't find anything that would work easily if the source files are copied over the network.

-- 
Brian Bennett
Looking for CFEngine training?
Seats available for 4-day class beginning Feb 2, 2015
http://www.verticalsysadmin.com/


--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.

Andreas K

unread,
Sep 24, 2014, 3:52:16 AM9/24/14
to help-c...@googlegroups.com, andreas....@googlemail.com, brian....@verticalsysadmin.com
Yes, the source file is on the network.

The question is, why is the warning or information (source file does not exist on server) raised to an error when passing the "usebundle"?

I think any errors should be managed / reported in the called bundle, not in the calling one...

Andreas

Ivan Kurnosov

unread,
Dec 15, 2014, 5:22:29 PM12/15/14
to help-c...@googlegroups.com
Hi,

it's exactly the same issue I experience with package promises.

Reply all
Reply to author
Forward
0 new messages