X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2Fconfig_default.py;h=8fd549aac56e19d0e7290850b3aba506e9c7e96f;hb=5148b9f217612f5044034a3f2efd7a69a9a25529;hp=00ababf2433b83f12b16de8dd97c147204a13849;hpb=9d9c35913d1312a42ef63fc665f44aabc80cf001;p=tests.git diff --git a/system/config_default.py b/system/config_default.py index 00ababf..8fd549a 100644 --- a/system/config_default.py +++ b/system/config_default.py @@ -1,5 +1,6 @@ +# -*- python3 -*- # Thierry Parmentelat -# Copyright (C) 2010 INRIA +# Copyright (C) 2015 INRIA # # a configuration module is expected: # (*) to define a config method @@ -461,7 +462,7 @@ def tcp_specs (options,index): specs += [ same_node_same_slice ] # worth another try specs += [ same_node_2_slices ] - if options.size >1 : + if options.size > 1: specs += [ two_nodes_same_slice, two_nodes_2_slices ] return specs @@ -518,7 +519,7 @@ def plc (options,index) : 'initscripts': initscripts(options,index), 'slices' : slices(options,index), 'tcp_specs' : tcp_specs(options,index), - 'sfa' : sfa(options,index), + 'sfa' : sfa(options,index), 'leases' : leases (options, index), # big distros need more time to install nodes 'ssh_node_boot_timers': (40,38), @@ -611,9 +612,26 @@ def test_auth_sfa_spec (options,index,rspec_style): } -def config (plc_specs,options): - result=plc_specs +def config (plc_specs, options): + result = plc_specs # plc 'index' starts with 1 - for i in range (options.size): - result.append(plc(options,i+1)) + for i in range(options.size): + result.append(plc(options, i+1)) return result + +### for creating a sample config interactively +def sample_test_plc_spec (): + class Void: pass + + options = Void() + options.size = 1 + options.rspec_styles = ['pg'] + + return config([], options)[0] + +if __name__ == '__main__': + s = sample_test_plc_spec() + print('Sample plc_spec has the following keys') + for k in sorted(s.keys()): + print(k) +