git://git.onelab.eu
/
nodemanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
54c53b5
)
minor cosmetic in conf_files
author
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Sat, 29 Dec 2018 13:51:47 +0000
(14:51 +0100)
committer
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Sat, 29 Dec 2018 13:51:47 +0000
(14:51 +0100)
conf_files.py
patch
|
blob
|
history
diff --git
a/conf_files.py
b/conf_files.py
index
7fb28cb
..
8bc3186
100755
(executable)
--- a/
conf_files.py
+++ b/
conf_files.py
@@
-5,15
+5,12
@@
import grp
import os
import pwd
import grp
import os
import pwd
-try:
- from hashlib import sha1 as sha
-except ImportError:
- from sha import sha
+from hashlib import sha1 as sha
+import xmlrpc.client
import curlwrapper
import logger
import tools
import curlwrapper
import logger
import tools
-import xmlrpc.client
from config import Config
# right after net
from config import Config
# right after net
@@
-39,7
+36,8
@@
class conf_files:
else: return 0
def update_conf_file(self, cf_rec):
else: return 0
def update_conf_file(self, cf_rec):
- if not cf_rec['enabled']: return
+ if not cf_rec['enabled']:
+ return
dest = cf_rec['dest']
err_cmd = cf_rec['error_cmd']
mode = int(cf_rec['file_permissions'], base=8)
dest = cf_rec['dest']
err_cmd = cf_rec['error_cmd']
mode = int(cf_rec['file_permissions'], base=8)
@@
-56,8
+54,8
@@
class conf_files:
url = 'https://%s/%s' % (self.config.PLC_BOOT_HOST, cf_rec['source'])
# set node_id at the end of the request - hacky
if tools.node_id():
url = 'https://%s/%s' % (self.config.PLC_BOOT_HOST, cf_rec['source'])
# set node_id at the end of the request - hacky
if tools.node_id():
- if url.find('?') >0: url += '&'
- else: url += '?'
+ if url.find('?') >
0: url += '&'
+ else:
url += '?'
url += "node_id=%d"%tools.node_id()
else:
logger.log('conf_files: %s -- WARNING, cannot add node_id to request'%dest)
url += "node_id=%d"%tools.node_id()
else:
logger.log('conf_files: %s -- WARNING, cannot add node_id to request'%dest)