Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Reflects renaming of old domain_api context

  • Loading branch information...
commit 8982301ef8a2dd6ccfde4ee27a776ac5cfe98c60 1 parent 41c9b24
Jim Crossley jcrossley3 authored
Showing with 13 additions and 13 deletions.
  1. +13 −13 lib/torquespec/as7.rb
26 lib/torquespec/as7.rb
View
@@ -14,7 +14,7 @@ def start_command
end
def shutdown
- domain_api( :operation => "shutdown" )
+ api( :operation => "shutdown" )
rescue EOFError
# ignorable
end
@@ -22,30 +22,30 @@ def shutdown
def _deploy(path)
once = true
begin
- domain_api( :operation => "add",
- :address => [ "deployment", addressify(path) ],
- :content => [ { :url=>urlify(path)} ] )
- rescue Exception=>e
+ api( :operation => "add",
+ :address => [ "deployment", addressify(path) ],
+ :content => [ { :url=>urlify(path)} ] )
+ rescue Exception
_undeploy(path)
if once
once = false
retry
else
- raise e
+ raise
end
end
- domain_api( :operation => "deploy",
- :address => [ "deployment", addressify(path) ] )
+ api( :operation => "deploy",
+ :address => [ "deployment", addressify(path) ] )
end
def _undeploy(path)
- domain_api( :operation => "remove",
- :address => [ "deployment", addressify(path) ] )
+ api( :operation => "remove",
+ :address => [ "deployment", addressify(path) ] )
end
def ready?
- response = JSON.parse( domain_api( :operation => "read-attribute",
- :name => "server-state") )
+ response = JSON.parse( api( :operation => "read-attribute",
+ :name => "server-state") )
response['outcome'].downcase=='success' && response['result'].downcase=='running'
rescue
false
@@ -53,7 +53,7 @@ def ready?
private
- def domain_api(params)
+ def api(params)
post('/management', params.merge('json.pretty' => 1).to_json)
end
Please sign in to comment.
Something went wrong with that request. Please try again.