The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/pylxd/pull/372

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
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
From 08d97d126cb6d3e5b16c321cb1130d38c3dce7a7 Mon Sep 17 00:00:00 2001
From: Drew Freiberger <drew.freiber...@canonical.com>
Date: Mon, 19 Aug 2019 16:15:21 -0500
Subject: [PATCH] Updated example of profile updating and saving

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
---
 doc/source/profiles.rst | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/doc/source/profiles.rst b/doc/source/profiles.rst
index d7dadf11..e69ebed5 100644
--- a/doc/source/profiles.rst
+++ b/doc/source/profiles.rst
@@ -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
@@ -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`
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to