conoha 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8138e24b52ed1c5a4023775b0684fe795f06aa92
4
- data.tar.gz: 20f742039466b4821723a56fa79fa8ad22ac0d99
3
+ metadata.gz: ac751abfdbf9197a651f6f9570478d976e6b698a
4
+ data.tar.gz: 727004f482358fd6b6c3874061310d4b83e75197
5
5
  SHA512:
6
- metadata.gz: c1ef16539ecbd2ec8a3ef33c8b1e0eab1e44936b110529cae743e45e2d8abf77e4100cafc1e8a536cb7790c471f3fa0b5f31e94bf995c331a2b254348640cf4f
7
- data.tar.gz: 6c72c0488c04caa126ddc0b2f0165f8747f058e6cc7e6cba5f6302dd096972d8a887f5302e0577108a1436c9ad58b57ad6b970a46bd8b32b9246185d342acc52
6
+ metadata.gz: 1eb48d0487e6e223921c74bcffa4eb198c7a6c4e4979660bca8f6de8abea045d3c3f0f080f4caaa846f5eefc56d66d3a853d9901eda834e6ae80a1b26a68d7ed
7
+ data.tar.gz: f3b39f5e4ba91ce66e85f22d9d00d8624cd65f504a978f3a4f0f4fe79f680c9624e2ee722d6de638bab38cc555dcc86a6652d2efae6b6e33401700ab0ff72926
@@ -29,14 +29,21 @@ def dump_conoharant_status(status)
29
29
  File.open('.conoharant/status.yml', 'w').print(YAML.dump(status))
30
30
  end
31
31
 
32
- require 'conoha'
33
32
  require 'conoha/version'
33
+ arg = ARGV.first
34
+ case arg
35
+ when 'version', '--version', '-v'
36
+ puts ConohaVersion::ITSELF
37
+ exit 0
38
+ end
39
+
40
+ require 'conoha'
34
41
  Conoha.init!
35
42
  begin
36
43
  Conoha.vps_list
37
44
  rescue => e
38
- puts "Auth token is invalid."
39
- puts "Reauthenticating..."
45
+ puts "# Auth token is invalid."
46
+ puts "# Reauthenticating..."
40
47
  begin
41
48
  Conoha.authenticate!
42
49
  rescue => e
@@ -45,12 +52,9 @@ rescue => e
45
52
  exit 1
46
53
  end
47
54
  end
48
- puts "Authentication OK."
55
+ puts "# Authentication OK."
49
56
 
50
- arg = ARGV.first
51
57
  case arg
52
- when 'version', '--version', '-v'
53
- puts ConohaVersion::ITSELF
54
58
  when 'status'
55
59
  puts status['status']
56
60
  when 'up'
@@ -154,7 +158,7 @@ when 'clean'
154
158
  status['image-tags'] = status['image-tags'][-2..-1]
155
159
  dump_conoharant_status status
156
160
  else
157
- puts "Nothing to do."
161
+ puts "# Nothing to do."
158
162
  end
159
163
  when 'browse'
160
164
  server_id = status['id']
@@ -71,13 +71,13 @@ class Conoha
71
71
 
72
72
  def self.boot(server_id)
73
73
  uri = "https://compute.tyo1.conoha.io/v2/#{tenant_id}/servers/#{server_id}/action"
74
- res = https_post uri, {"os-start": nil}, authtoken
74
+ res = https_post uri, {"os-start" => nil}, authtoken
75
75
  res.code == '202' ? 'OK' : 'Error'
76
76
  end
77
77
 
78
78
  def self.shutdown(server_id)
79
79
  uri = "https://compute.tyo1.conoha.io/v2/#{tenant_id}/servers/#{server_id}/action"
80
- res = https_post uri, {"os-stop": nil}, authtoken
80
+ res = https_post uri, {"os-stop" => nil}, authtoken
81
81
  res.code == '202' ? 'OK' : 'Error'
82
82
  end
83
83
 
@@ -89,7 +89,7 @@ class Conoha
89
89
 
90
90
  def self.create_image(server_id, name)
91
91
  uri = "https://compute.tyo1.conoha.io/v2/#{tenant_id}/servers/#{server_id}/action"
92
- res = https_post uri, {"createImage": {"name": name}}, authtoken
92
+ res = https_post uri, {"createImage" => {"name" => name}}, authtoken
93
93
  res.code == '202' ? 'OK' : 'Error'
94
94
  end
95
95
 
@@ -1,3 +1,3 @@
1
1
  module ConohaVersion
2
- ITSELF = "0.2.4"
2
+ ITSELF = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conoha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-22 00:00:00.000000000 Z
11
+ date: 2015-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler