72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/biosphere/s3.rb', line 72
def set_lock()
begin
resp = @client.get_object({
:bucket => @bucket_name,
:key => "#{@main_key}/biosphere.lock"
})
puts "\nThe remote state is locked since #{resp.last_modified}\nCan't continue."
exit 1
rescue Aws::S3::Errors::NoSuchKey
puts "\nRemote state was not locked, adding the lockfile.\n"
@client.put_object({
:bucket => @bucket_name,
:key => "#{@main_key}/biosphere.lock"
})
rescue
puts "\There was an error while accessing the lock. Can't continue.'"
puts "Error: #{$!}"
exit 1
end
end
|