Skip to content

Commit

Permalink
Refactor duplicates.
Browse files Browse the repository at this point in the history
  • Loading branch information
merqlove committed Aug 2, 2015
1 parent 771f258 commit ef3418b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
11 changes: 11 additions & 0 deletions lib/do_snapshot/adapter/abstract.rb
Expand Up @@ -18,6 +18,17 @@ def initialize(options = {})
end
end

# Power On request for Droplet
#
def start_droplet(id)
# noinspection RubyResolve
instance = droplet(id)

return power_on(id) unless instance.status.include?('active')

logger.error "Droplet #{id} is still running. Skipping."
end

protected

def set_id; end
Expand Down
11 changes: 0 additions & 11 deletions lib/do_snapshot/adapter/digitalocean.rb
Expand Up @@ -29,17 +29,6 @@ def snapshots(instance)
instance.snapshots
end

# Power On request for Droplet
#
def start_droplet(id)
# noinspection RubyResolve
instance = droplet(id)

return power_on(id) unless instance.status.include? 'active'

logger.error "Droplet #{id} is still running. Skipping."
end

# Request Power On for droplet
#
def power_on(id)
Expand Down
11 changes: 0 additions & 11 deletions lib/do_snapshot/adapter/digitalocean_v2.rb
Expand Up @@ -31,17 +31,6 @@ def snapshots(instance)
instance.snapshot_ids
end

# Power On request for Droplet
#
def start_droplet(id)
# noinspection RubyResolve
instance = droplet(id)

return power_on(id) unless instance.status.include?('active')

logger.error "Droplet #{id} is still running. Skipping."
end

# Request Power On for droplet
#
def power_on(id)
Expand Down

0 comments on commit ef3418b

Please sign in to comment.