X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=time-slider.git;a=blobdiff_plain;f=usr%2Fshare%2Ftime-slider%2Flib%2Ftime_slider%2Fsmf.py;h=074190aab9b6ebd91b0e0f2cbfb8ae1bd83afc9e;hp=bdefadaafc992e75ff251535ee7b300ef485fe3d;hb=HEAD;hpb=89b01bcd6deccb79cbdb9f1b06b2613e45850434 diff --git a/usr/share/time-slider/lib/time_slider/smf.py b/usr/share/time-slider/lib/time_slider/smf.py index bdefada..074190a 100644 --- a/usr/share/time-slider/lib/time_slider/smf.py +++ b/usr/share/time-slider/lib/time_slider/smf.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/python3 # # CDDL HEADER START # @@ -22,7 +22,7 @@ import subprocess import threading -import util +from . import util #SMF EXIT CODES SMF_EXIT_OK = 0 @@ -120,25 +120,25 @@ class SMFInstance(Exception): def refresh_service(self): cmd = [SVCADMCMD, "refresh", self.instanceName] - p = subprocess.Popen(cmd, close_fds=True) + util.run_command(cmd) def disable_service (self): if self.svcstate == "disabled": return cmd = [SVCADMCMD, "disable", self.instanceName] - p = subprocess.Popen(cmd, close_fds=True) + util.run_command(cmd) self.svcstate = self.get_service_state() def enable_service (self): if (self.svcstate == "online" or self.svcstate == "degraded"): return cmd = [SVCADMCMD, "enable", self.instanceName] - p = subprocess.Popen(cmd, close_fds=True) + util.run_command(cmd) self.svcstate = self.get_service_state() def mark_maintenance (self): cmd = [SVCADMCMD, "mark", "maintenance", self.instanceName] - subprocess.Popen(cmd, close_fds=True) + util.run_command(cmd) def __str__(self): ret = "SMF Instance:\n" +\ @@ -149,5 +149,5 @@ class SMFInstance(Exception): if __name__ == "__main__": S = SMFInstance('svc:/application/time-slider') - print S + print(S)