git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cosmetic
[plcapi.git]
/
PLC
/
Methods
/
GenerateNodeConfFile.py
diff --git
a/PLC/Methods/GenerateNodeConfFile.py
b/PLC/Methods/GenerateNodeConfFile.py
index
a121264
..
dc34ae2
100644
(file)
--- a/
PLC/Methods/GenerateNodeConfFile.py
+++ b/
PLC/Methods/GenerateNodeConfFile.py
@@
-1,4
+1,5
@@
# $Id$
# $Id$
+# $URL$
import random
import base64
import random
import base64
@@
-27,7
+28,7
@@
class GenerateNodeConfFile(Method):
Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
Auth(),
Mixed(Node.fields['node_id'],
Node.fields['hostname']),
- Parameter(bool, "True if you want to regenerate node key")
+
Parameter(bool, "True if you want to regenerate node key")
]
returns = Parameter(str, "Node configuration file")
]
returns = Parameter(str, "Node configuration file")
@@
-48,7
+49,7
@@
class GenerateNodeConfFile(Method):
if node['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Not allowed to generate a configuration file for that node"
if node['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Not allowed to generate a configuration file for that node"
- # Get interfaces for this node
+
# Get interfaces for this node
primary = None
interfaces = Interfaces(self.api, node['interface_ids'])
for interface in interfaces:
primary = None
interfaces = Interfaces(self.api, node['interface_ids'])
for interface in interfaces:
@@
-65,7
+66,7
@@
class GenerateNodeConfFile(Method):
host = parts[0]
domain = parts[1]
host = parts[0]
domain = parts[1]
- if regenerate_node_key:
+
if regenerate_node_key:
# Generate 32 random bytes
bytes = random.sample(xrange(0, 256), 32)
# Base64 encode their string representation
# Generate 32 random bytes
bytes = random.sample(xrange(0, 256), 32)
# Base64 encode their string representation