|
@@ -35,13 +35,16 @@ class sispmctl(object):
|
35
|
35
|
return output
|
36
|
36
|
|
37
|
37
|
def set_out_state(self, output, state):
|
38
|
|
- output = self.__filter_output_parameter__(output)
|
39
|
38
|
if output == "all":
|
40
|
|
- state = [state, state, state, state]
|
|
39
|
+ if self.__state__ != [state, state, state, state]:
|
|
40
|
+ self.__set_out_state__(output, state)
|
|
41
|
+ else:
|
|
42
|
+ if self.__state__[int(output) - 1] != state:
|
|
43
|
+ self.__set_out_state__(output, state)
|
41
|
44
|
|
42
|
|
- if self.__state__[output - 1] != state:
|
|
45
|
+ def __set_out_state__(self, output, state):
|
43
|
46
|
try:
|
44
|
|
- out_txt = subprocess.check_output(["sudo", "sispmctl", "-o" if state == True or state == [True, True, True, True] else "-f", str(output)]).decode('UTF-8')
|
|
47
|
+ out_txt = subprocess.check_output(["sudo", "sispmctl", "-o" if state == True else "-f", output]).decode('UTF-8')
|
45
|
48
|
except subprocess.CalledProcessError as grepexc:
|
46
|
49
|
logger.error("sispm error code %d", grepexc.returncode)
|
47
|
50
|
else:
|