move_obstructions doesn't belong in the link_from body, it's part of the parent 
promise.  See example from docs:

files:

   "/tmp/testcopy"

     copy_from    => mycopy("/tmp/source"),
     move_obstructions => "true",
     depth_search => recurse("inf");

The example shows it paired with a copy_from, but I think it should work with a 
link_from as well.
--
/* Wes Hardin */
UNIX System Administrator, IT Engineering Support
Maxim Integrated Products: Innovation Delivered

On 07/28/2010 10:07 AM, JIM AMANATIDIS, BLOOMBERG/ 731 LEXIN wrote:
>
> I tried that, got error:
>
> # cf-promises
> cf3:/var/cfengine/inputs/libs.cf:41,30: Constraint lvalue move_obstructions 
> is not allowed in 'link_from' constraint body, near token 'true"'
>
> Here is the body:
>
> body link_from ln_s(x) {
>    link_type =>  "symlink";
>    source =>  "$(x)";
>    move_obstructions  =>  "true";
> }
>
>
>
> ----- Original Message -----
> From: Wes Hardin<wes.har...@maxim-ic.com>
> To: JIM AMANATIDIS (BLOOMBERG/ 731 LEXIN)
> Cc: help-cfengine@cfengine.org
> At:  7/28 11:01:09
>
> Maybe you need "move_obstructions" then?
>
> http://www.cfengine.org/manuals/cf3-reference.html#move_005fobstructions-in-files
>
> --
> /* Wes Hardin */
> UNIX System Administrator, IT Engineering Support
> Maxim Integrated Products: Innovation Delivered
>
> On 07/28/2010 09:52 AM, JIM AMANATIDIS, BLOOMBERG/ 731 LEXIN wrote:
>> Thanks, but that's not the issue I am having.
>>
>> My source file already exists (it's a plain file)
>> My target file also exists.
>> With ->! I was able to nuke the plain file and establish a symbolic link to 
>> the target file.
>>
>> I looked at the reference documentation, the "when_no_source" parameter 
>> doesn't help because the source is already there, it's a plain file.
>>
>> Also, documentation says "when_no_file", I tried that as well, I get:
>> Constraint lvalue when_no_file is not allowed in 'link_from' constraint 
>> body, near token 'force"'
>>
>> I am using Cfengine - 3.0.4p1 (C) Cfengine AS 2008-
>>
>> Thanks.
>>
>>
>> ----- Original Message -----
>> From: no-re...@cfengine.com
>> To: help-cfengine@cfengine.org
>> At:  7/28 10:35:30
>>
>> Forum: Cfengine Help
>> Subject: Re: cfengine v3 equivalent of ->! symbolic links
>> Author: neilhwatson
>> Link to topic: https://cfengine.com/forum/read.php?3,17802,17803#msg-17803
>>
>> ‘when_no_source’ ?  
>> http://www.cfengine.org/manuals/cf3-reference.html#link_005ffrom-in-files
>>
>> _______________________________________________
>> Help-cfengine mailing list
>> Help-cfengine@cfengine.org
>> https://cfengine.org/mailman/listinfo/help-cfengine
>> _______________________________________________
>> Help-cfengine mailing list
>> Help-cfengine@cfengine.org
>> https://cfengine.org/mailman/listinfo/help-cfengine

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

Reply via email to