summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--cloudinit/util.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 366292d3..dc2b95ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,7 @@
- add OpenNebula Datasource [Vlastimil Holer]
- add 'cc_disk_setup' config module for paritioning disks and creating
filesystems. Useful if attached disks are not formatted (LP: #1218506)
+ - Fix usage of libselinux-python when selinux is disabled. [Garret Holmstrom]
0.7.2:
- add a debian watch file
- add 'sudo' entry to ubuntu's default user (LP: #1080717)
diff --git a/cloudinit/util.py b/cloudinit/util.py
index d50d3e18..deac8c8d 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -161,13 +161,13 @@ class SeLinuxGuard(object):
self.recursive = recursive
def __enter__(self):
- if self.selinux:
+ if self.selinux and self.selinux.is_selinux_enabled():
return True
else:
return False
def __exit__(self, excp_type, excp_value, excp_traceback):
- if self.selinux:
+ if self.selinux and self.selinux.is_selinux_enabled():
path = os.path.realpath(os.path.expanduser(self.path))
do_restore = False
try: