Skip to content

Commit

Permalink
Updated example of profile updating and saving (#372)
Browse files Browse the repository at this point in the history
It was discovered that using profile.config and profile.devices as left-hand-sides to a .update function was setting them to "none" and the profile.update() was not actually saving.  profile.save() was also causing the profile settings to be blanked out due to the NoneTypes being set to profile.config and profile.devices.  Also expanded profile attribute descriptions to explicitly note types
  • Loading branch information
Drew Freiberger authored and ajkavanagh committed Aug 20, 2019
1 parent 068bc78 commit bf43969
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions doc/source/profiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ methods:
Profile attributes
------------------

- `config` - config options for containers
- `description` - The description of the profile
- `devices` - device options for containers
- `name` - The name of the profile
- `used_by` - A list of containers using this profile
- `config` - (dict) config options for containers
- `description` - (str) The description of the profile
- `devices` - (dict) device options for containers
- `name` - (str) name of the profile
- `used_by` - (list) containers using this profile


Profile methods
Expand All @@ -51,8 +51,9 @@ Containers and Images. Profiles are keyed on a unique name.
The profile can then be modified and saved.

>>> profile.config = profile.config.update({'security.nesting': 'true'})
>>> profile.update()
>>> profile.config.update({'security.nesting': 'true'})
>>> profile.devices.update({"eth0": {"parent": "lxdbr0", "nictype": "bridged", "type": "nic", "name": "eth0"}})
>>> profile.save()


To create a new profile, use `create` with a name, and optional `config`
Expand Down

0 comments on commit bf43969

Please sign in to comment.