diff --git a/Makefile b/Makefile index eab2751..49c8737 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ PKG_NAME=oci-cn-auth PKG_DESCRIPTION="OCI cluster network authentication tool" PKG_VERSION=0.2.6 -PKG_RELEASE=2 +PKG_RELEASE=0 PKG_MAINTAINER="Marcin Zablocki \" PKG_ARCH=all PKG_ARCH_RPM=noarch diff --git a/src/var/lib/oci-cn-auth/lib/util.py b/src/var/lib/oci-cn-auth/lib/util.py index 71d63d0..cbfe046 100644 --- a/src/var/lib/oci-cn-auth/lib/util.py +++ b/src/var/lib/oci-cn-auth/lib/util.py @@ -62,7 +62,7 @@ def disable(self): return lib.systemd.disable(self.service)['status'] def delete(self): - if os.path.isfile(self.unitfile): + if self.unit: return os.remove(self.unitfile) else: return False @@ -84,7 +84,7 @@ def create_unit(self, write=True): tmpfile.write(template) tmpfile.flush() - if self.unitfile: + if self.unit: if not filecmp.cmp(tmpfile.name, self.unitfile): @@ -211,17 +211,12 @@ def check_units(config, write=True, start=True): interface = RdmaInterface(i) should_configure = _should_configure(config, interface) - if should_configure: + if should_configure: if interface.service.create_unit(write=False): - if not write: - print('Unit {} needs updating'.format(interface.interface)) - else: - print('Updating unit: {}'.format(interface.interface)) + print('Updating unit: {}'.format(interface.interface)) interface.service.create_unit() - if write: - print('Reloading systemd') - lib.systemd.reload() - + print('Reloading systemd') + lib.systemd.reload() else: print('[ OK ] {}'.format(interface.service.service))