summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2020-05-20 11:56:36 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2020-05-20 12:04:28 +0200
commit147c8906179dd265db1b0d0387f9806eb899099d (patch)
tree73086d9c3a1defea699f132c0f51ff40e6ad1eff /src
parent6502180fc8be0a7307622963c147ab1b74ecb47d (diff)
Fix OgLinuxOperations class params
Commit 621fb7a7 added class initialization with two parameters. These two parameters were wrongly initialized, "self." was missing. The call of these params in other functions of the class was also wrong. This commit fix the initialization of the parameters of OgLinuxOperations and fix the calls to these params.
Diffstat (limited to 'src')
-rw-r--r--src/linux/ogOperations.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py
index 3638268..88313ba 100644
--- a/src/linux/ogOperations.py
+++ b/src/linux/ogOperations.py
@@ -15,8 +15,8 @@ OG_SHELL = '/bin/bash'
class OgLinuxOperations:
def __init__(self, config):
- _url = config['opengnsys']['url']
- _url_log = config['opengnsys']['url_log']
+ self._url = config['opengnsys']['url']
+ self._url_log = config['opengnsys']['url_log']
def _restartBrowser(self, url):
try:
@@ -70,7 +70,7 @@ class OgLinuxOperations:
cmd = request.getrun()
cmds = cmd.split(";|\n\r")
- self._restartBrowser(OgLinuxOperations._url_log)
+ self._restartBrowser(self._url_log)
try:
ogRest.proc = subprocess.Popen(cmds,
@@ -83,7 +83,7 @@ class OgLinuxOperations:
cmd_get_conf = f'{ogConfig.OG_PATH}interfaceAdm/getConfiguration'
result = subprocess.check_output([cmd_get_conf], shell=True)
- self._restartBrowser(OgLinuxOperations._url)
+ self._restartBrowser(self._url)
return output.decode('utf-8')
@@ -107,7 +107,7 @@ class OgLinuxOperations:
disk = request.getDisk()
partition = request.getPartition()
- self._restartBrowser(OgLinuxOperations._url_log)
+ self._restartBrowser(self._url_log)
try:
cmd = f'{ogConfig.OG_PATH}interfaceAdm/InventarioSoftware {disk} ' \
@@ -121,7 +121,7 @@ class OgLinuxOperations:
except:
raise ValueError('Error: Incorrect command value')
- self._restartBrowser(OgLinuxOperations._url)
+ self._restartBrowser(self._url)
software = ''
with open(path, 'r') as f:
@@ -129,7 +129,7 @@ class OgLinuxOperations:
return software
def hardware(self, path, ogRest):
- self._restartBrowser(OgLinuxOperations._url_log)
+ self._restartBrowser(self._url_log)
try:
cmd = f'{ogConfig.OG_PATH}interfaceAdm/InventarioHardware {path}'
@@ -141,7 +141,7 @@ class OgLinuxOperations:
except:
raise ValueError('Error: Incorrect command value')
- self._restartBrowser(OgLinuxOperations._url)
+ self._restartBrowser(self._url)
return output.decode('utf-8')
@@ -172,7 +172,7 @@ class OgLinuxOperations:
cmd_get_conf = f'{ogConfig.OG_PATH}interfaceAdm/getConfiguration'
result = subprocess.check_output([cmd_get_conf], shell=True)
- self._restartBrowser(OgLinuxOperations._url)
+ self._restartBrowser(self._url)
return self.parseGetConf(result.decode('utf-8'))
@@ -187,7 +187,7 @@ class OgLinuxOperations:
cmd = f'{ogConfig.OG_PATH}interfaceAdm/RestaurarImagen {disk} {partition} ' \
f'{name} {repo} {ctype}'
- self._restartBrowser(OgLinuxOperations._url_log)
+ self._restartBrowser(self._url_log)
try:
ogRest.proc = subprocess.Popen([cmd],
@@ -200,7 +200,7 @@ class OgLinuxOperations:
cmd_get_conf = f'{ogConfig.OG_PATH}interfaceAdm/getConfiguration'
result = subprocess.check_output([cmd_get_conf], shell=True)
- self._restartBrowser(OgLinuxOperations._url)
+ self._restartBrowser(self._url)
return output.decode('utf-8')
@@ -214,7 +214,7 @@ class OgLinuxOperations:
cmd_create_image = f'{ogConfig.OG_PATH}interfaceAdm/CrearImagen {disk} ' \
f'{partition} {name} {repo}'
- self._restartBrowser(OgLinuxOperations._url_log)
+ self._restartBrowser(self._url_log)
try:
ogRest.proc = subprocess.Popen([cmd_software],
@@ -237,12 +237,12 @@ class OgLinuxOperations:
except:
raise ValueError('Error: Incorrect command value')
- self._restartBrowser(OgLinuxOperations._url)
+ self._restartBrowser(self._url)
return output.decode('utf-8')
def refresh(self, ogRest):
- self._restartBrowser(OgLinuxOperations._url_log)
+ self._restartBrowser(self._url_log)
try:
cmd = f'{ogConfig.OG_PATH}interfaceAdm/getConfiguration'
@@ -254,6 +254,6 @@ class OgLinuxOperations:
except:
raise ValueError('Error: Incorrect command value')
- self._restartBrowser(OgLinuxOperations._url)
+ self._restartBrowser(self._url)
return self.parseGetConf(output.decode('utf-8'))