268
269
270
271
272
273
274
275
276
277
278
279
|
# File 'lib/openc3/models/tool_model.rb', line 268
def undeploy
if @folder_name and @folder_name.to_s.length > 0
bucket = Bucket.getClient
prefix = "#{@folder_name}/"
bucket.list_objects(bucket: ENV['OPENC3_TOOLS_BUCKET'], prefix: prefix).each do |object|
bucket.delete_object(bucket: ENV['OPENC3_TOOLS_BUCKET'], key: object.key)
ConfigTopic.write({ kind: 'deleted', type: 'tool', name: @folder_name, plugin: @plugin }, scope: @scope)
end
end
rescue Exception => error
Logger.error("Error undeploying tool model #{@name} in scope #{@scope} due to #{error}")
end
|