[lxc-users] Config settings and Python LXC Api calls

Stéphane Graber stgraber at ubuntu.com
Fri Aug 29 01:10:30 UTC 2014


On Thu, Aug 28, 2014 at 05:56:29PM -0700, Kevin LaTona wrote:
> 
> On Aug 27, 2014, at 7:20 PM, Stéphane Graber <stgraber at ubuntu.com> wrote:
> 
> > On Wed, Aug 27, 2014 at 06:36:20PM -0700, Kevin LaTona wrote:
> 
> 
> > 
> >> 
> >> Question 2……Python LXC Api calls
> >> 
> >> Does any one know if the Python API has a call that parse's all the key names from a container's config file?
> >> 
> >> I see a getter and setter for them, but that means I need to know ahead of time what config settings are in a file.
> >> 
> >> VS 
> >> 
> >> Wanting to be able to read a config file's Keys on the fly and reacting based on that?
> > 
> > load_config
> 
> 
> 
> So far not what I am looking for as this returns a boolean saying if a config file is loaded or not.
> 
> I was looking to see if there was an exisiting API call that would return just the Key names from an existing user's container file.
> 
> Not sounding like there is anything like that in the Python API yet… time to do a little loop.

Ah right, there's get_keys() which will get you the full list but that's
not limited to what you currently have in your config, so you indeed
need to iterate through those afterwards.

> 
> Thanks
> -Kevin
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140828/02a5356e/attachment.sig>


More information about the lxc-users mailing list