neptune 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/neptune.rb +9 -10
  2. metadata +4 -4
@@ -125,12 +125,11 @@ end
125
125
  # job. By default, job data is private, but a Neptune
126
126
  # job can be used to set it to public later (and
127
127
  # vice-versa).
128
- def job(name, &block)
128
+ def neptune(params)
129
129
  puts "Received a request to run a job."
130
- puts name
131
- block.call()
130
+ puts params[:type]
132
131
 
133
- keyname = @keyname || "appscale"
132
+ keyname = params[:keyname] || "appscale"
134
133
 
135
134
  shadow_ip = CommonFunctions.get_from_yaml(keyname, :shadow)
136
135
  secret = CommonFunctions.get_secret_key(keyname)
@@ -138,13 +137,13 @@ def job(name, &block)
138
137
  ssh_key = File.expand_path("~/.appscale/#{keyname}.key")
139
138
 
140
139
  job_data = {}
141
- instance_variables.each { |var|
142
- job_data[var] = instance_variable_get(var)
140
+ params.each { |k, v|
141
+ key = "@#{k}"
142
+ job_data[key] = v
143
143
  }
144
144
 
145
145
  job_data["@job"] = nil
146
- job_data["@type"] = name
147
- job_data["@keyname"] = keyname
146
+ job_data["@keyname"] = keyname || "appscale"
148
147
 
149
148
  if (job_data["@output"].nil? or job_data["@output"] == "")
150
149
  abort("Job output must be specified")
@@ -207,9 +206,9 @@ def job(name, &block)
207
206
  else
208
207
  result = controller.start_neptune_job(job_data)
209
208
  if result =~ /job is now running\Z/
210
- return :success
209
+ return {:result => :success, :msg => result}
211
210
  else
212
- return :failure
211
+ return {:result => :failure, :msg => result}
213
212
  end
214
213
  end
215
214
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neptune
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Bunch
@@ -15,7 +15,7 @@ autorequire: neptune
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-04 00:00:00 -08:00
18
+ date: 2011-02-09 00:00:00 -08:00
19
19
  default_executable: neptune
20
20
  dependencies: []
21
21