summaryrefslogtreecommitdiff
path: root/cloudinit/distros/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rw-r--r--cloudinit/distros/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 71da7ec5..5879dabf 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -371,7 +371,7 @@ class Distro(object):
kwargs['groups'] = ",".join(groups)
else:
groups = groups.split(",")
-
+
primary_group = kwargs.get('primary_group')
if primary_group:
groups.append(primary_group)
@@ -940,7 +940,10 @@ def set_etc_timezone(tz, tz_file=None, tz_conf="/etc/timezone",
# This ensures that the correct tz will be used for the system
if tz_local and tz_file:
# use a symlink if there exists a symlink or tz_local is not present
- if os.path.islink(tz_local) or not os.path.exists(tz_local):
+ islink = os.path.islink(tz_local)
+ if islink or not os.path.exists(tz_local):
+ if islink:
+ util.del_file(tz_local)
os.symlink(tz_file, tz_local)
else:
util.copy(tz_file, tz_local)