summaryrefslogtreecommitdiff
path: root/reconfigure/items/passwd.py
diff options
context:
space:
mode:
Diffstat (limited to 'reconfigure/items/passwd.py')
-rw-r--r--reconfigure/items/passwd.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/reconfigure/items/passwd.py b/reconfigure/items/passwd.py
new file mode 100644
index 0000000..147bc8a
--- /dev/null
+++ b/reconfigure/items/passwd.py
@@ -0,0 +1,15 @@
+from reconfigure.items.bound import BoundData
+
+
+class PasswdData (BoundData):
+ pass
+
+
+class UserData (BoundData):
+ fields = ['name', 'password', 'uid', 'gid', 'comment', 'home', 'shell']
+
+
+PasswdData.bind_collection('users', item_class=UserData)
+for i in range(0, len(UserData.fields)):
+ path = lambda i: lambda x: x.children[i]
+ UserData.bind_property('value', UserData.fields[i], path=path(i))