Re: Found out all of the nics cards on a system

Jerome Verleyen <[email protected]> Thu, 21 Nov 2024 13:07:26 -0600
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
Le 20/11/2024 à 22:34, Nick Anderson a écrit :
> Without running it myself and inspecting the details...
>
> You don't see reports for this promise:
>       "Value of sys_interfaces $(sys_interfaces)";
>
> Because sys_interfaces isn't defined.
>
> It's not defined because getindices() on a list has no result. I think 
> it would make sense that it return the numeric positions of the 
> elements, basically length - 1 and there might even be a ticket with 
> that request, but it's a very niche case when you could just iterate 
> on sys.interfaces. The docs do indicate the function takes an array 
> (classic associative), or data container.
> https://docs.cfengine.com/docs/3.24/reference-functions-getindices.html
>
> You can copy the list like this:
>
>    "sys_interfaces" slist => { @(sys.interfaces) };


Dear Nick.

You're right! Thank's for your explanations. As you can imagine, i'm 
very new in this stuff..

Regards!

-- 
-- Jérôme
En essayant continuellement, on finit par réussir. Donc:
Plus ça rate, plus on a de chance que ça marche.
	(Devise Shadok)

-- 
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 [email protected].
To view this discussion visit https://groups.google.com/d/msgid/help-cfengine/61fb1847-602a-4855-abfb-b40ab7174f81%40ibt.unam.mx.