cloud-maker 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -230,7 +230,7 @@ class CloudMakerCLI < Thor
230
230
  else
231
231
  exit 1
232
232
  end
233
- rescue Exception => e
233
+ rescue CloudMaker::Config::ContentNotFound => e
234
234
  say e.to_s.red
235
235
  exit 1
236
236
  end
@@ -97,12 +97,12 @@ module CloudMaker
97
97
  self.imports = extract_imports!(cloud_config)
98
98
  self.cloud_config = cloud_config
99
99
 
100
- self.import(self.class.new(EC2::CLOUD_MAKER_CONFIG)) if (extra_options['import_ec2'])
100
+ self.import(self.class.new(EC2::CLOUD_MAKER_CONFIG, 'config_path' => "EC2")) if (extra_options['import_ec2'])
101
101
 
102
102
  # It's important here that reverse duplicates the imports array as executing the import will
103
103
  # add the imported configs imports to the list and we do NOT want to reimport those as well.
104
104
  self.imports.reverse.each do |import_path|
105
- self.import(self.class.from_yaml(import_path, self.extra_options))
105
+ self.import(self.class.from_yaml(import_path, self.extra_options.merge('import_ec2' => false)))
106
106
  end
107
107
  self['tags'] ||= {}
108
108
  self['tags']['cloud_maker_config'] = self.config_name
@@ -113,7 +113,10 @@ module CloudMaker
113
113
  files.push self.extra_options['config_path'] if self.extra_options['config_path']
114
114
 
115
115
  files.reverse.map { |import|
116
- import[import.rindex('/')+1..-1].gsub(/\..*/, '').gsub(/[^\w]/, '-')
116
+ if import.rindex('/')
117
+ import = import[import.rindex('/')+1..-1]
118
+ end
119
+ import.gsub(/\..*/, '').gsub(/[^\w]/, '-')
117
120
  }.join(':')
118
121
  end
119
122
 
@@ -267,8 +270,8 @@ module CloudMaker
267
270
  end
268
271
  else
269
272
  begin
270
- full_path = File.expand_path(instance_config_yaml)
271
- cloud_yaml = File.open(full_path, "r") #Right_AWS will base64 encode this for us
273
+ instance_config_yaml = File.expand_path(instance_config_yaml)
274
+ cloud_yaml = File.open(instance_config_yaml, "r") #Right_AWS will base64 encode this for us
272
275
  rescue
273
276
  raise FileContentNotFound.new("Unable to access the configuration via your local file system from #{full_path}.", instance_config_yaml)
274
277
  end
@@ -278,7 +281,7 @@ module CloudMaker
278
281
  # it like this makes sanity checking other missing values easy.
279
282
  config = YAML::load(cloud_yaml) || {}
280
283
 
281
- CloudMaker::Config.new(config, options.merge('config_path' => full_path))
284
+ CloudMaker::Config.new(config, options.merge('config_path' => instance_config_yaml))
282
285
  end
283
286
  end
284
287
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud-maker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: