conoha 0.3.1 → 0.4.0

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: 08efbeb2adcb082922b6449cc5ba9d350f3142c3
4
- data.tar.gz: 0e1154adce0023bfbe0d7a3f4b0b7c2bd01b9807
3
+ metadata.gz: 473062afde273a22ca4cab8b773969a30ebf637d
4
+ data.tar.gz: c1adfc08fa4d96a4f18a0b45e5ac1accf4106456
5
5
  SHA512:
6
- metadata.gz: ffbb04f40a8d3ff7544133f0540fe52df5a04bea9fc591b778f3628ad9bc181edda998c5041fe62e271b7187c0b5d5fd4b5f0b5a6dba73edc09750346935f614
7
- data.tar.gz: 513cd536da2a1c68a253c00c0d01556d7d1203a2839989a9e63844bc10eda880a7a6a4ad2932e557bf2b23286b75dde51c97a39bd734096926eb1f6a2417d307
6
+ metadata.gz: 28765775ca83749b33288dd4a8580da4cbae39a2c3bd43b4d7bdcd621da432105c80d47f46b7cbe26972c2a134d3b3e14b6f845bd0b1b1cbb0abf1b6045efa55
7
+ data.tar.gz: 18aad9e6376a7eecfb14fcbbc8b50048479965d6b17548905f539474c2e9b56c9d9e7fbcce615a302648331626f1c7370a89db231b609a778a64da70dc7a802a
data/exe/conoha CHANGED
@@ -34,7 +34,13 @@ case subcommand
34
34
  when 'version', '--version', '-v'
35
35
  puts ConohaVersion::ITSELF
36
36
  when 'authenticate'
37
- Conoha.authenticate!
37
+ begin
38
+ Conoha.authenticate!
39
+ rescue => e
40
+ STDERR.puts "Failed to authenticate."
41
+ STDERR.puts "Retry after modifying \"~/.conoha-config.json\"."
42
+ exit 1
43
+ end
38
44
  puts 'Succeeded!'
39
45
  when 'vpslist'
40
46
  pp Conoha.vps_list
@@ -19,6 +19,9 @@ class Conoha
19
19
  }
20
20
  }
21
21
  res = https_post uri, payload, nil
22
+ if res.code == '401'
23
+ raise StandardError.new 'Authentication failure'
24
+ end
22
25
  @@authtoken = JSON.parse(res.body)["access"]["token"]["id"]
23
26
  save_config!
24
27
  end
@@ -1,3 +1,3 @@
1
1
  module ConohaVersion
2
- ITSELF = "0.3.1"
2
+ ITSELF = "0.4.0"
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.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-13 00:00:00.000000000 Z
11
+ date: 2016-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler