lib/cloud_providers/ec2/ec2.rb in auser-poolparty-1.3.10 vs lib/cloud_providers/ec2/ec2.rb in auser-poolparty-1.3.11
- old
+ new
@@ -157,11 +157,11 @@
# Callbacks
def before_compile(cld)
end
def after_compile(cld)
- save_aws_env_to_yml(cld.tmp_path/"etc"/"poolparty"/"env.yml")
+ save_aws_env_to_yml(cld.tmp_path/"etc"/"poolparty"/"env.yml") rescue nil
end
# Read yaml file and use it to set environment variables and local variables.
def set_aws_env_from_yml_file(filename='/etc/poolparty/env.yml')
aws = self.class.load_keys_from_file(filename)
@@ -169,10 +169,11 @@
set_vars_from_options aws
end
# Save aws keys and env variables to a yaml file
def save_aws_env_to_yml(filename='/etc/poolparty/env.yml')
- File.open(filename, 'w') {|f| f<<YAML::dump(aws_hash(dsl_options, "/etc/poolparty/ec2")) } rescue nil
+ hsh = aws_hash(default_options, "/etc/poolparty/ec2")
+ File.open(filename, 'w') {|f| f<<YAML::dump(hsh) }
end
# Return a hash of the aws keys and environment variables
# If base_dir string is provided as second argument, replace path to
# file based variables, such as cert, with the base_dir.
\ No newline at end of file