conoha 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/conoha +14 -1
  3. data/lib/conoha/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23a302e2a98f7d85cb64145d435fe61524e4eb4b
4
- data.tar.gz: 51efd4a1cf521d2193347a4cd2f68fe33277f6e8
3
+ metadata.gz: 7cf6ebf48cffae67556f4b2628f2164e22cb2c75
4
+ data.tar.gz: 7889f59934b25b0ad0cf7278e7049d992ee970f5
5
5
  SHA512:
6
- metadata.gz: 7c5be9acd315ec8077ec66eba2458cc0317e4f9e37322567786d29293173ea082adaee3307840bba7b8b04e3dcd388b622dfc951e28f9421dd712f61f418168d
7
- data.tar.gz: f0aecf8e31031cfc3715a2378a52d9247262270d06f18114163528bb9e2aa0aa652a8d6e84bb8a497b05286f19ab1bc566fbe290d36c0d93d4c6ba163911c211
6
+ metadata.gz: f1fab20c72b8d1924f492e9427d20dc20e077ac5d3938938a903dacf8eaf6632be1d0a29c53cb9155e533b7adb152b713fced8e8f668bce7ea93506eefb80dea
7
+ data.tar.gz: d2b3436f23a5ec7f7d368e0c3d8e1ac37dca89b6aa08d4af0f70d05673e39428d7b7b22813473df2223a0f67422158b9ece07212898c4cf0a5ebb33c73f630a4
data/exe/conoha CHANGED
@@ -17,6 +17,19 @@ def server_id(server_id_or_index)
17
17
  end
18
18
  end
19
19
 
20
+ def image_ref_or_name(str)
21
+ if str.length == '01234567-89ab-cdef-0123-456789abcdef'.length
22
+ str
23
+ else
24
+ x = Conoha.images.find { |e| e[0] == str }
25
+ if x.nil?
26
+ STDERR.puts "There is no image the name \"#{str}\"."
27
+ exit 1
28
+ end
29
+ x[1]
30
+ end
31
+ end
32
+
20
33
  case subcommand
21
34
  when 'authenticate'
22
35
  Conoha.authenticate!
@@ -49,7 +62,7 @@ when 'imagedelete'
49
62
  puts Conoha.delete_image image_ref
50
63
  when 'createfromimage'
51
64
  exit 1 if ARGV.size != 2
52
- image_ref = ARGV[0]
65
+ image_ref = image_ref_or_name ARGV[0]
53
66
  ram = ARGV[1]
54
67
  puts Conoha.create_from_image image_ref, ram
55
68
  when 'ssh'
@@ -1,3 +1,3 @@
1
1
  module ConohaVersion
2
- ITSELF = "0.0.5"
2
+ ITSELF = "0.0.6"
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.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-24 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler