X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=PLC%2FMethods%2FGenerateNodeConfFile.py;h=dc34ae278cbea61b6829356cdedb84d4ac71a401;hb=e2e924a46c15afa1a91b395c2daec68c62e0552e;hp=a121264978d0bd4cf42aa288eec1161bee2ceea9;hpb=db42a908647b5116ecc3d63800fee6662d036914;p=plcapi.git diff --git a/PLC/Methods/GenerateNodeConfFile.py b/PLC/Methods/GenerateNodeConfFile.py index a121264..dc34ae2 100644 --- a/PLC/Methods/GenerateNodeConfFile.py +++ b/PLC/Methods/GenerateNodeConfFile.py @@ -1,4 +1,5 @@ # $Id$ +# $URL$ import random import base64 @@ -27,7 +28,7 @@ class GenerateNodeConfFile(Method): 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") @@ -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" - # Get interfaces for this node + # Get interfaces for this node 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] - if regenerate_node_key: + if regenerate_node_key: # Generate 32 random bytes bytes = random.sample(xrange(0, 256), 32) # Base64 encode their string representation