summaryrefslogtreecommitdiff
path: root/reconfigure/items
diff options
context:
space:
mode:
authorAndrew Shadura <andrew@shadura.me>2015-08-20 16:04:48 +0200
committerAndrew Shadura <andrew@shadura.me>2015-08-20 16:04:48 +0200
commit2989b4c027b3230b1778e3777d2cce53c89808d9 (patch)
treeeaae33622a6ced0a09a5610d79ab9d54e77a5a9f /reconfigure/items
parent1e93e1498efdfd85a599a7e831f4a3a55f78aa75 (diff)
Imported Upstream version 0.1.74+git49a20890
Diffstat (limited to 'reconfigure/items')
-rw-r--r--reconfigure/items/group.py12
-rw-r--r--reconfigure/items/passwd.py12
2 files changed, 24 insertions, 0 deletions
diff --git a/reconfigure/items/group.py b/reconfigure/items/group.py
index f95b28a..107bc64 100644
--- a/reconfigure/items/group.py
+++ b/reconfigure/items/group.py
@@ -1,3 +1,4 @@
+from reconfigure.nodes import Node, PropertyNode
from reconfigure.items.bound import BoundData
@@ -8,6 +9,17 @@ class GroupsData (BoundData):
class GroupData (BoundData):
fields = ['name', 'password', 'gid', 'users']
+ def template(self):
+ return Node(
+ 'line',
+ *[
+ Node('token', children=[
+ PropertyNode('value', '')
+ ])
+ for x in GroupData.fields
+ ]
+ )
+
GroupsData.bind_collection('groups', item_class=GroupData)
for i in range(0, len(GroupData.fields)):
diff --git a/reconfigure/items/passwd.py b/reconfigure/items/passwd.py
index 147bc8a..6943300 100644
--- a/reconfigure/items/passwd.py
+++ b/reconfigure/items/passwd.py
@@ -1,3 +1,4 @@
+from reconfigure.nodes import Node, PropertyNode
from reconfigure.items.bound import BoundData
@@ -8,6 +9,17 @@ class PasswdData (BoundData):
class UserData (BoundData):
fields = ['name', 'password', 'uid', 'gid', 'comment', 'home', 'shell']
+ def template(self):
+ return Node(
+ 'line',
+ *[
+ Node('token', children=[
+ PropertyNode('value', '')
+ ])
+ for x in UserData.fields
+ ]
+ )
+
PasswdData.bind_collection('users', item_class=UserData)
for i in range(0, len(UserData.fields)):