summaryrefslogtreecommitdiff
path: root/tests/data/merge_sources
diff options
context:
space:
mode:
authordermotbradley <dermot_bradley@yahoo.com>2020-10-30 20:12:38 +0000
committerGitHub <noreply@github.com>2020-10-30 16:12:38 -0400
commitf8c84aeead77b7e508644d94889ee701f20e8d31 (patch)
treecf1dd65855d28c7d55366a6ab3ce4f7678ebe18e /tests/data/merge_sources
parent0f8be879073148f1d67094df9ec895a873caa0d7 (diff)
downloadvyos-cloud-init-f8c84aeead77b7e508644d94889ee701f20e8d31.tar.gz
vyos-cloud-init-f8c84aeead77b7e508644d94889ee701f20e8d31.zip
Correct documentation and testcase data for some user-data YAML (#618)
For cc_users_groups the user setting "expiredate" must be quoted in order for the relevant flag and value to be then passed to the useradd command. It its vaiue is not quoted then it is treated as Python type datetime.date and in `cloudinit/distros/__init__.py` the below "is it a string" condition fails and so no "--expiredate" parameter is passed to useradd and therefore it has no effect: ``` if key in useradd_opts and val and isinstance(val, str): useradd_cmd.extend([useradd_opts[key], val]) ``` For cc_users_groups, the user setting "inactive" does not actually disable accounts, the useradd "--inactive" option actually defines the number of days after password expiry that users can still login. So I have changed the docs to show it taking a quoted value of days (which works with the current code) rather than a boolean value. The quotes are necessary, like expiredate above, so that the value is also passed to the useradd command. For cc_power_state_change.py the "delay" setting value needs to have quotes around it as otherwise its leading plus sign will be stripped off.
Diffstat (limited to 'tests/data/merge_sources')
-rw-r--r--tests/data/merge_sources/expected10.yaml2
-rw-r--r--tests/data/merge_sources/expected7.yaml6
-rw-r--r--tests/data/merge_sources/source10-1.yaml2
-rw-r--r--tests/data/merge_sources/source7-1.yaml4
-rw-r--r--tests/data/merge_sources/source7-2.yaml2
5 files changed, 8 insertions, 8 deletions
diff --git a/tests/data/merge_sources/expected10.yaml b/tests/data/merge_sources/expected10.yaml
index b865db16..e9f88f7b 100644
--- a/tests/data/merge_sources/expected10.yaml
+++ b/tests/data/merge_sources/expected10.yaml
@@ -1,7 +1,7 @@
#cloud-config
power_state:
- delay: 30
+ delay: '+30'
mode: poweroff
message: [Bye, Bye, Pew, Pew]
diff --git a/tests/data/merge_sources/expected7.yaml b/tests/data/merge_sources/expected7.yaml
index d32988e8..8186d13a 100644
--- a/tests/data/merge_sources/expected7.yaml
+++ b/tests/data/merge_sources/expected7.yaml
@@ -7,7 +7,7 @@ users:
primary_group: foobar
groups: users
selinux_user: staff_u
- expiredate: 2012-09-01
+ expiredate: '2012-09-01'
ssh_import_id: foobar
lock-passwd: false
passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/
@@ -22,7 +22,7 @@ users:
- <ssh pub key 2>
- name: cloudy
gecos: Magic Cloud App Daemon User
- inactive: true
+ inactive: '5'
system: true
- bob
- joe
@@ -32,7 +32,7 @@ users:
primary_group: foobar
groups: users
selinux_user: staff_u
- expiredate: 2012-09-01
+ expiredate: '2012-09-01'
ssh_import_id: foobar
lock-passwd: false
passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/
diff --git a/tests/data/merge_sources/source10-1.yaml b/tests/data/merge_sources/source10-1.yaml
index 6ae72a13..36fd336d 100644
--- a/tests/data/merge_sources/source10-1.yaml
+++ b/tests/data/merge_sources/source10-1.yaml
@@ -1,6 +1,6 @@
#cloud-config
power_state:
- delay: 30
+ delay: '+30'
mode: poweroff
message: [Bye, Bye]
diff --git a/tests/data/merge_sources/source7-1.yaml b/tests/data/merge_sources/source7-1.yaml
index 6405fc9b..ec93079f 100644
--- a/tests/data/merge_sources/source7-1.yaml
+++ b/tests/data/merge_sources/source7-1.yaml
@@ -7,7 +7,7 @@ users:
primary_group: foobar
groups: users
selinux_user: staff_u
- expiredate: 2012-09-01
+ expiredate: '2012-09-01'
ssh_import_id: foobar
lock-passwd: false
passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/
@@ -22,6 +22,6 @@ users:
- <ssh pub key 2>
- name: cloudy
gecos: Magic Cloud App Daemon User
- inactive: true
+ inactive: '5'
system: true
diff --git a/tests/data/merge_sources/source7-2.yaml b/tests/data/merge_sources/source7-2.yaml
index 0cd28978..0c02abff 100644
--- a/tests/data/merge_sources/source7-2.yaml
+++ b/tests/data/merge_sources/source7-2.yaml
@@ -9,7 +9,7 @@ users:
primary_group: foobar
groups: users
selinux_user: staff_u
- expiredate: 2012-09-01
+ expiredate: '2012-09-01'
ssh_import_id: foobar
lock-passwd: false
passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/