knife-joyent 0.0.10 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,35 +1,37 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/base')
1
+ require 'chef/knife/joyent_base'
2
2
 
3
- module KnifeJoyent
4
- class JoyentTagList < Chef::Knife
3
+ class Chef
4
+ class Knife
5
+ class JoyentTagList < Knife
5
6
 
6
- include KnifeJoyent::Base
7
+ include Knife::JoyentBase
7
8
 
8
- banner "knife joyent tag list <server>"
9
+ banner "knife joyent tag list <server>"
9
10
 
10
- def run
11
- server = name_args.first
11
+ def run
12
+ server = name_args.first
12
13
 
13
- unless server
14
- show_usage
15
- exit 1
16
- end
14
+ unless server
15
+ show_usage
16
+ exit 1
17
+ end
17
18
 
18
- tags = [
19
- ui.color('Name', :bold),
20
- ui.color('Value', :bold),
21
- ]
19
+ tags = [
20
+ ui.color('Name', :bold),
21
+ ui.color('Value', :bold),
22
+ ]
22
23
 
23
- self.connection.servers.get(server).tags.each do |k, v|
24
- tags << k
25
- tags << v
26
- end
24
+ self.connection.servers.get(server).tags.each do |k, v|
25
+ tags << k
26
+ tags << v
27
+ end
27
28
 
28
- puts ui.list(tags, :uneven_columns_across, 2)
29
- exit 0
30
- rescue Excon::Errors::NotFound => e
31
- puts ui.error("Server #{server} not found")
32
- exit 1
29
+ puts ui.list(tags, :uneven_columns_across, 2)
30
+ exit 0
31
+ rescue Excon::Errors::NotFound => e
32
+ puts ui.error("Server #{server} not found")
33
+ exit 1
34
+ end
33
35
  end
34
36
  end
35
37
  end
@@ -1,3 +1,3 @@
1
1
  module KnifeJoyent
2
- VERSION = "0.0.10"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-joyent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-26 00:00:00.000000000 Z
12
+ date: 2012-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '1.3'
21
+ version: '1.6'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,23 +26,23 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: '1.3'
29
+ version: '1.6'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: chef
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ~>
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: '0.10'
37
+ version: 0.10.10
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ~>
43
+ - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: '0.10'
45
+ version: 0.10.10
46
46
  description: Joyent CloudAPI Support for Chef's Knife Command
47
47
  email:
48
48
  - kevin@joyent.com
@@ -58,7 +58,7 @@ files:
58
58
  - README.md
59
59
  - Rakefile
60
60
  - knife-joyent.gemspec
61
- - lib/chef/knife/base.rb
61
+ - lib/chef/knife/joyent_base.rb
62
62
  - lib/chef/knife/joyent_flavor_list.rb
63
63
  - lib/chef/knife/joyent_image_list.rb
64
64
  - lib/chef/knife/joyent_key_add.rb
@@ -1,58 +0,0 @@
1
- require 'chef/knife'
2
-
3
- module KnifeJoyent
4
- module Base
5
-
6
- def self.included(includer)
7
- includer.class_eval do
8
- deps do
9
- require 'fog'
10
- require 'net/ssh/multi'
11
- require 'readline'
12
- require 'chef/json_compat'
13
- end
14
-
15
- option :joyent_username,
16
- :short => '-U USERNAME',
17
- :long => '--joyent-username USERNAME',
18
- :description => 'Your Joyent username',
19
- :proc => Proc.new {|key| Chef::Config[:knife][:joyent_username] = key}
20
-
21
- option :joyent_password,
22
- :short => '-P PASSWORD',
23
- :long => '--joyent-password PASSOWRD',
24
- :description => 'Your Joyent password',
25
- :proc => Proc.new {|key| Chef::Config[:knife][:joyent_password] = key }
26
-
27
- option :joyent_keyname,
28
- :long => '--joyent-keyname name of ssh key for signature auth',
29
- :description => 'name of ssh key for signature auth',
30
- :proc => Proc.new {|key| Chef::Config[:knife][:joyent_keyname] = key }
31
-
32
- option :joyent_keyfile,
33
- :long => '--joyent-keyfile path to ssh private key for signature auth',
34
- :description => 'path to ssh private key for signature auth',
35
- :proc => Proc.new {|key| Chef::Config[:knife][:joyent_keyfile] = key }
36
-
37
- option :joyent_api_url,
38
- :short => "-L JOYENT_API_URL",
39
- :long => "--joyent-api-url JOYENT_API_URL",
40
- :description => "Joyent API URL",
41
- :proc => Proc.new {|key| Chef::Config[:knife][:joyent_api_url] = key }
42
- end
43
-
44
- def connection
45
- @connection ||= begin
46
- connection = Fog::Compute.new(
47
- :provider => 'Joyent',
48
- :joyent_username => Chef::Config[:knife][:joyent_username],
49
- :joyent_password => Chef::Config[:knife][:joyent_password],
50
- :joyent_keyname => Chef::Config[:knife][:joyent_keyname],
51
- :joyent_keyfile => Chef::Config[:knife][:joyent_keyfile],
52
- :joyent_url => Chef::Config[:knife][:joyent_api_url]
53
- )
54
- end
55
- end
56
- end
57
- end
58
- end