Update README.md to specify the python requirements
[time-slider.git] / usr / share / time-slider / lib / time_slider / smf.py
index bdefada..074190a 100644 (file)
@@ -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)