lib/gaptool_client/commands.rb in gaptool-client-0.8.0.pre.alpha8 vs lib/gaptool_client/commands.rb in gaptool-client-0.8.0.pre.alpha9
- old
+ new
@@ -1,7 +1,7 @@
# coding: utf-8
-# rubocop:disable Metrics/LineLength, Lint/Eval
+# rubocop:disable Metrics/LineLength
#
require 'rainbow'
require 'json'
require 'clamp'
require 'set'
@@ -222,24 +222,16 @@
pre_hook = proc do |node|
if node['chef_runlist'].nil?
runlist = ['recipe[main]']
elsif node['chef_runlist'].is_a? Array
runlist = node['chef_runlist']
- else
- runlist = eval(node['chef_runlist'])
end
json = {
- 'this_server' => "#{node['role']}-#{node['environment']}-#{node['instance']}",
'role' => node['role'],
'environment' => node['environment'],
- 'app_user' => node['appuser'],
'run_list' => runlist,
- 'hostname' => node['hostname'],
- 'instance' => node['instance'],
- 'zone' => node['zone'],
- 'itype' => node['itype'],
- 'apps' => eval(node['apps'] || '[]'),
+ 'apps' => node['apps'] || [],
'gaptool' => {
'user' => ENV['GT_USER'],
'key' => ENV['GT_KEY'],
'url' => ENV['GT_URL']
}
@@ -314,11 +306,11 @@
res = !seen.include?(x['instance'])
seen << x['instance']
res
end
nodes = nodes.map do |x|
- x['apps'] = eval(x['apps'])
+ x['apps'] = x['apps']
x['apps_to_deploy'] = (Set.new(x['apps']) & app_set).to_a
x['rollback'] = rollback?
x['branch'] = branch || 'master'
x['migrate'] = migrate?
x['attrs'] = attrs
@@ -334,22 +326,14 @@
if node['chef_runlist'].nil?
runlist = ['recipe[deploy]']
elsif node['chef_runlist'].is_a? Array
runlist = node['chef_runlist']
- else
- runlist = eval(node['chef_runlist'])
end
json = {
- 'this_server' => "#{node['role']}-#{node['environment']}-#{node['instance']}",
'role' => node['role'],
'environment' => node['environment'],
- 'app_user' => node['appuser'],
'run_list' => runlist,
- 'hostname' => node['hostname'],
- 'instance' => node['instance'],
- 'zone' => node['zone'],
- 'itype' => node['itype'],
'apps' => node['apps'],
'deploy_apps' => node['apps_to_deploy'],
'rollback' => node['rollback'],
'branch' => node['branch'],
'migrate' => node['migrate'],