bbcloud 0.11.1 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -96,7 +96,7 @@ class BBConfig
96
96
  end
97
97
 
98
98
  def to_fog
99
- raise Ini::Error, "No api client configured" if clients.empty?
99
+ raise Ini::Error, "No api client configured" unless configured?
100
100
  c = config[client_name]
101
101
  %w{api_url client_id secret}.each do |k|
102
102
  if c[k].to_s.empty?
@@ -129,7 +129,7 @@ class BBConfig
129
129
 
130
130
  def finish
131
131
  begin
132
- if @oauth_token != Api.conn.oauth_token
132
+ if configured? and @oauth_token != Api.conn.oauth_token
133
133
  File.open(oauth_token_filename + ".#{$$}", "w") do |f|
134
134
  f.write Api.conn.oauth_token
135
135
  end
@@ -141,4 +141,8 @@ class BBConfig
141
141
 
142
142
  end
143
143
 
144
+ def configured?
145
+ client_name != nil and !clients.empty?
146
+ end
147
+
144
148
  end
@@ -1,3 +1,3 @@
1
1
  module Brightbox
2
- VERSION = "0.11.1"
2
+ VERSION = "0.11.2"
3
3
  end
@@ -6,7 +6,8 @@ _brightbox()
6
6
  local cur prev
7
7
 
8
8
  COMPREPLY=()
9
- _get_comp_words_by_ref cur prev
9
+ cur=`_get_cword`
10
+ prev=${COMP_WORDS[COMP_CWORD-1]}
10
11
 
11
12
  command=''
12
13
  for (( i=1; i < COMP_CWORD; i++ )); do
@@ -21,7 +22,7 @@ _brightbox()
21
22
  case $command in
22
23
  create)
23
24
  case $prev in
24
- -f|--user_data_file)
25
+ -f|--user-data-file)
25
26
  _filedir
26
27
  return 0
27
28
  ;;
@@ -35,7 +36,7 @@ _brightbox()
35
36
  test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
36
37
  fi
37
38
  ;;
38
- destroy|list|show|shutdown|snapshot|start|stop)
39
+ destroy|list|show|shutdown|snapshot|start|stop|activate_console)
39
40
  test -d ~/.brightbox/cache && COMPREPLY=( $( compgen -W '`ls ~/.brightbox/cache/`' -- "$cur" ) )
40
41
  ;;
41
42
  *)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bbcloud
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 11
9
- - 1
10
- version: 0.11.1
9
+ - 2
10
+ version: 0.11.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Leach