diff options
author | Thomas Backlund <tmb@mageia.org> | 2015-10-20 00:03:40 +0300 |
---|---|---|
committer | Thomas Backlund <tmb@mageia.org> | 2015-10-20 00:03:40 +0300 |
commit | 537a14a19d232672f15a41aa8b4e0423b2fb216e (patch) | |
tree | 01cdccef44da06300fbe57911966b78ee777afb3 /modules/buildsystem/templates/youri | |
parent | a0621b95e1cdd3c87ff7eb8e25884d27f3938e4b (diff) | |
download | puppet-537a14a19d232672f15a41aa8b4e0423b2fb216e.tar puppet-537a14a19d232672f15a41aa8b4e0423b2fb216e.tar.gz puppet-537a14a19d232672f15a41aa8b4e0423b2fb216e.tar.bz2 puppet-537a14a19d232672f15a41aa8b4e0423b2fb216e.tar.xz puppet-537a14a19d232672f15a41aa8b4e0423b2fb216e.zip |
lint fixes for buildsystem
Diffstat (limited to 'modules/buildsystem/templates/youri')
-rw-r--r-- | modules/buildsystem/templates/youri/host.conf | 24 | ||||
-rw-r--r-- | modules/buildsystem/templates/youri/submit.conf | 78 |
2 files changed, 51 insertions, 51 deletions
diff --git a/modules/buildsystem/templates/youri/host.conf b/modules/buildsystem/templates/youri/host.conf index 35f4043b..559417e0 100644 --- a/modules/buildsystem/templates/youri/host.conf +++ b/modules/buildsystem/templates/youri/host.conf @@ -3,21 +3,21 @@ nodes = {} nodes['src'] = scope.lookupvar('buildsystem::var::scheduler::build_src_node') scope.lookupvar('buildsystem::var::scheduler::build_nodes').each{|arch,n| - a = arch + '|noarch|src' - nodes[a] = [] - n.each{|node| - if aliases[node] != nil - nodes[a] += [ aliases[node] ] - else - nodes[a] += [ node ] - end - } + a = arch + '|noarch|src' + nodes[a] = [] + n.each{|node| + if aliases[node] != nil + nodes[a] += [ aliases[node] ] + else + nodes[a] += [ node ] + end + } } str = '' nodes.keys.sort.each{|arch| - nodes[arch].sort.uniq.each{|node| - str += node + ' ' + arch + "\n" - } + nodes[arch].sort.uniq.each{|node| + str += node + ' ' + arch + "\n" + } } -%> <%= str -%> diff --git a/modules/buildsystem/templates/youri/submit.conf b/modules/buildsystem/templates/youri/submit.conf index 233020ba..0d7cf927 100644 --- a/modules/buildsystem/templates/youri/submit.conf +++ b/modules/buildsystem/templates/youri/submit.conf @@ -1,4 +1,4 @@ -<% +<% Puppet::Parser::Functions.autoloader.loadall sched_home_dir = scope.lookupvar('buildsystem::var::scheduler::homedir') @@ -10,8 +10,8 @@ def line(text, indent) res = '' i = 0 while i < indent - res += ' ' - i += 1 + res += ' ' + i += 1 end res += text + "\n" end @@ -19,7 +19,7 @@ end def array_text(array, indent) res = '' array.each{|a| - res += line('- ' + a, indent) + res += line('- ' + a, indent) } return res end @@ -28,15 +28,15 @@ def hash_text(hash, indent) res = '' curindent = indent hash.keys.sort.each{|key| - if hash[key].instance_of? Hash - res += line(key + ':', indent) - res += hash_text(hash[key], indent + 4) - elsif hash[key].instance_of? Array - res += line(key + ':', indent) - res += array_text(hash[key], indent + 4) - elsif hash[key].instance_of? String - res += line(key + ': ' + hash[key], indent) - end + if hash[key].instance_of? Hash + res += line(key + ':', indent) + res += hash_text(hash[key], indent + 4) + elsif hash[key].instance_of? Array + res += line(key + ':', indent) + res += array_text(hash[key], indent + 4) + elsif hash[key].instance_of? String + res += line(key + ': ' + hash[key], indent) + end } return res end @@ -44,11 +44,11 @@ end def class_hash(conf, conf_default) res = {} res['class'] = get_conf(conf, ['class']) == nil ? - conf_default['class'] : conf['class'] - res['options'] = get_conf(conf_default, ['options']) == nil ? {} : - conf_default['options'].dup + conf_default['class'] : conf['class'] + res['options'] = get_conf(conf_default, ['options']) == nil ? {} : + conf_default['options'].dup if get_conf(conf, ['options']) != nil - res['options'].merge!(conf['options']) + res['options'].merge!(conf['options']) end return res end @@ -56,10 +56,10 @@ end def get_conf(conf, path) res = conf path.each{|p| - if res == nil - return nil - end - res = res[p] + if res == nil + return nil + end + res = res[p] } return res end @@ -67,10 +67,10 @@ end def get_distros_conf(distros, conf_name, path) res = {} distros.keys.each{|distro| - t = get_conf(distros[distro], [ 'youri', conf_name ] + path) - if t != nil - res[distro] = t.dup - end + t = get_conf(distros[distro], [ 'youri', conf_name ] + path) + if t != nil + res[distro] = t.dup + end } return res end @@ -80,14 +80,14 @@ def get_definitions(def_name, conf_name, conf, conf_default, distros) res[def_name] = {} def_list = conf_default[conf_name][def_name].keys def_list += get_conf(conf, [ conf_name, def_name ]) != nil ? \ - conf[conf_name][def_name].keys : [] + conf[conf_name][def_name].keys : [] def_list.uniq.each{|d| - res[def_name][d] = class_hash( - get_conf(conf, [ conf_name, def_name, d ]), - get_conf(conf_default, [ conf_name, def_name, d ]) - ) - res[def_name][d]['options'].merge!(get_distros_conf(distros, - conf_name, [ def_name, d ])) + res[def_name][d] = class_hash( + get_conf(conf, [ conf_name, def_name, d ]), + get_conf(conf_default, [ conf_name, def_name, d ]) + ) + res[def_name][d]['options'].merge!(get_distros_conf(distros, + conf_name, [ def_name, d ])) } return res end @@ -97,14 +97,14 @@ home: <%= sched_home_dir %> <%- repository = { - 'repository' => class_hash(get_conf(conf[conf_name], - ['repository']), - conf_default[conf_name]['repository']), + 'repository' => class_hash(get_conf(conf[conf_name], + ['repository']), + conf_default[conf_name]['repository']), } distros.keys.each{|distro| - repository['repository']['options'][distro] = { - 'arch' => distros[distro]['arch'].join(' '), - } + repository['repository']['options'][distro] = { + 'arch' => distros[distro]['arch'].join(' '), + } } -%> # repository declaration @@ -112,7 +112,7 @@ home: <%= sched_home_dir %> <%- targets = { - 'targets' => get_distros_conf(distros, conf_name, [ 'targets' ]), + 'targets' => get_distros_conf(distros, conf_name, [ 'targets' ]), } -%> # targets definition |