knife-topo 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d8793bcf153624c108933962031fa78522ad5a92
4
+ data.tar.gz: ccb909fe254ec685604d94a36bdacb342be00ae0
5
+ SHA512:
6
+ metadata.gz: e0fcdc312e8574d8dd7575ac1a22c9115fd2ea1e24235b92752bf1b6f4939f08d4ccdfb9078aa00ea1b46bbb4eb94d577afbb633e3f742dd2e0997daa954a7bd
7
+ data.tar.gz: fd58817d5fd0479352bcabcaa390086fd61504dc797ed6266fafd29b4c2683419a1237ea28c20bcec2390644599cd071d073ffda1f078aa40eebaae1caa49c25
data/README.md CHANGED
@@ -22,8 +22,8 @@ topologies but differences in their configuration details.
22
22
  [Download the latest knife-topo release](http://github.com/christinedraper/knife-topo/releases/latest),
23
23
  unzip and copy `lib/chef/knife` into your plugin directory, e.g.:
24
24
 
25
- $ unzip knife-topo-0.0.9.zip -d ~
26
- $ cd ~/knife-topo-0.0.9
25
+ $ unzip knife-topo-0.0.10.zip -d ~
26
+ $ cd ~/knife-topo-0.0.10
27
27
  $ mkdir -p ~/.chef/plugins/knife
28
28
  $ cp lib/chef/knife/* ~/.chef/plugins/knife
29
29
 
@@ -33,7 +33,8 @@ or install knife-topo as a gem
33
33
 
34
34
  You may need to use `sudo gem install knife-topo`, depending on your setup.
35
35
 
36
- This plugin has been tested with Chef Version 11.12 on Ubuntu 14.04 LTS, and run on Windows and Mac.
36
+ This plugin has been tested with Chef Version 11.12 and 12.0.3 on Ubuntu 12.04 and 14.04 LTS,
37
+ and run on Windows and Mac.
37
38
 
38
39
  Note: I've encountered a case (on a Mac) where knife was not configured to use
39
40
  gems on the gem path. If the gem install succeeds but `knife topo`
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module Topo
3
- VERSION = "0.0.10"
3
+ VERSION = "0.0.11"
4
4
  end
5
5
  end
@@ -85,7 +85,7 @@ class Chef
85
85
  cookbook_spec['filename'] + ".rb", cookbook_spec)
86
86
  end
87
87
  else
88
- ui.info "No cookbook attributes found for topology #{@topo_name}"
88
+ ui.info "No topology cookbook has been specified for topology #{@topo_name}"
89
89
  end
90
90
  end
91
91
 
@@ -99,7 +99,7 @@ class Chef
99
99
  command = run_cmd(Chef::Knife::CookbookCreate, @cookbook_create_args)
100
100
  rescue Exception => e
101
101
  raise if Chef::Config[:verbosity] == 2
102
- ui.warn "create of cookbook #{cookbook_name} exited with error"
102
+ ui.warn "Create of cookbook #{cookbook_name} exited with error"
103
103
  humanize_exception(e)
104
104
  end
105
105
 
@@ -84,8 +84,8 @@ class Chef
84
84
  topo.create
85
85
  rescue Net::HTTPServerException => e
86
86
  raise unless e.to_s =~ /^409/
87
- msg = "Topology already exists - do you want to update it"
88
- msg = msg + " to version " + topo['version'] if topo['version']
87
+ msg = "Topology #{display_name(topo)} already exists - do you want to update it"
88
+ msg = msg + " to version " + format_topo_version(topo) if topo['version']
89
89
  ui.confirm(msg, true, false)
90
90
  topo.save
91
91
  end
@@ -114,9 +114,6 @@ class Chef
114
114
  ui.info("Build information: " + topo_hash['buildstamp']) if topo_hash['buildstamp']
115
115
 
116
116
  end
117
-
118
-
119
-
120
117
 
121
118
  include Chef::Knife::TopologyHelper
122
119
 
@@ -63,6 +63,7 @@ class Chef
63
63
 
64
64
  topo_name = topo_data['name'] || topo_data['id']
65
65
  topo_data['id'] ||= topo_name
66
+ topo_data['name'] ||= topo_name
66
67
 
67
68
  if (!topo_name)
68
69
  ui.error "Could not find a topology name - #{topo_file} does not appear to be a valid topology JSON file"
@@ -83,17 +84,19 @@ class Chef
83
84
  File.open(path,"w") do |f|
84
85
  f.write(Chef::JSONCompat.to_json_pretty(topo_data))
85
86
  f.close()
86
- ui.info "Imported topology #{display_name(topo_data)} into #{path}"
87
+ ui.info "Created topology data bag in #{path}"
87
88
  end
88
89
 
89
90
  # run topo cookbook to generate the cookbooks for this topology
90
91
  @topo_cookbook_args[2] = topo_name
91
92
  @topo_cookbook_args[3] = topo_file
92
93
  run_cmd(Chef::Knife::TopoCookbookCreate, @topo_cookbook_args)
93
-
94
+ ui.info "Imported topology #{display_name(topo_data)}"
95
+ ui.info("Build information: " + topo_data['buildstamp']) if topo_data['buildstamp']
96
+
94
97
  end
95
98
 
96
- ui.info "Did not find topologies #{topo_names.join(', ')} in the exchange file" if topo_names && topo_names.length > 0
99
+ ui.info "Did not find topologies #{topo_names.join(', ')} in the topology json file" if topo_names && topo_names.length > 0
97
100
  ui.info "Import finished"
98
101
 
99
102
  end
@@ -72,13 +72,15 @@ class Chef
72
72
  ui.info "No topology found in #{topologies_path}/#{bag_name}/#{topo_name}.json - exiting without action"
73
73
  exit(0)
74
74
  end
75
-
75
+
76
76
  msg = "Updating topology #{display_name(current_topo)}"
77
- msg = msg + " to version " + topo['version'] if topo['version']
77
+ msg = msg + " to version " + format_topo_version(topo) if topo['version']
78
78
  ui.info msg
79
- ui.info("Build information: " + topo['buildstamp']) if topo['buildstamp']
80
79
 
81
80
  update_topo(topo)
81
+
82
+ ui.info "Updated topology " + display_name(topo)
83
+ ui.info("Build information: " + topo['buildstamp']) if topo['buildstamp']
82
84
 
83
85
  else
84
86
  # find all topologies from server then update them from file, skipping any that have no file
@@ -96,12 +98,16 @@ class Chef
96
98
  # do not update topologies that are not in the local workspace
97
99
  ui.info("No topology file found in #{topologies_path}/#{bag_name}/#{topo_name}.json - skipping")
98
100
  else
99
- ui.info("Updating topology #{display_name(topo)}")
101
+ msg = "Updating topology " + topo_name
102
+ msg = msg + " to version " + format_topo_version(topo) if topo['version']
103
+ ui.info msg
104
+ ui.info("Build information: " + topo['buildstamp']) if topo['buildstamp']
100
105
  update_topo(topo)
101
106
  end
102
107
  end
108
+ ui.info "Updated topologies"
109
+
103
110
  end
104
- ui.info "Updates done"
105
111
 
106
112
  end
107
113
 
@@ -294,7 +294,18 @@ class Chef
294
294
  end
295
295
 
296
296
  def display_name (topo)
297
- topo['name'] + ((topo['version']) ? " version " + topo['version'] : "")
297
+ topo['name'] + ((topo['version']) ? " version " + format_topo_version(topo) : "")
298
+ end
299
+
300
+ # Topology version
301
+ def format_topo_version(topo)
302
+ version = nil
303
+ if topo['version']
304
+ version = topo['version']
305
+ version = version + '-' + topo['buildid'] if (topo['buildid'])
306
+ end
307
+
308
+ version
298
309
  end
299
310
 
300
311
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-topo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
5
- prerelease:
4
+ version: 0.0.11
6
5
  platform: ruby
7
6
  authors:
8
7
  - Christine Draper
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-12-21 00:00:00.000000000 Z
11
+ date: 2015-02-01 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Knife plugin that to manage topologies of nodes
15
14
  email:
@@ -18,42 +17,41 @@ executables: []
18
17
  extensions: []
19
18
  extra_rdoc_files: []
20
19
  files:
21
- - lib/chef/knife/topo_export.rb
22
- - lib/chef/knife/topo_bootstrap.rb
20
+ - LICENSE
21
+ - README.md
22
+ - knife-topo.gemspec
23
23
  - lib/chef/knife/topo/version.rb
24
+ - lib/chef/knife/topo_bootstrap.rb
24
25
  - lib/chef/knife/topo_cookbook_create.rb
26
+ - lib/chef/knife/topo_cookbook_upload.rb
25
27
  - lib/chef/knife/topo_create.rb
26
- - lib/chef/knife/topo_update.rb
28
+ - lib/chef/knife/topo_export.rb
27
29
  - lib/chef/knife/topo_import.rb
30
+ - lib/chef/knife/topo_update.rb
28
31
  - lib/chef/knife/topology_helper.rb
29
- - lib/chef/knife/topo_cookbook_upload.rb
30
- - LICENSE
31
- - README.md
32
- - knife-topo.gemspec
33
32
  homepage: https://github.com/christinedraper/knife-topo
34
33
  licenses:
35
34
  - Apache License (2.0)
35
+ metadata: {}
36
36
  post_install_message:
37
37
  rdoc_options: []
38
38
  require_paths:
39
39
  - lib
40
40
  required_ruby_version: !ruby/object:Gem::Requirement
41
- none: false
42
41
  requirements:
43
- - - ! '>='
42
+ - - ">="
44
43
  - !ruby/object:Gem::Version
45
44
  version: '0'
46
45
  required_rubygems_version: !ruby/object:Gem::Requirement
47
- none: false
48
46
  requirements:
49
- - - ! '>='
47
+ - - ">="
50
48
  - !ruby/object:Gem::Version
51
49
  version: '0'
52
50
  requirements: []
53
51
  rubyforge_project:
54
- rubygems_version: 1.8.23
52
+ rubygems_version: 2.4.4
55
53
  signing_key:
56
- specification_version: 3
54
+ specification_version: 4
57
55
  summary: Knife plugin that to manage topologies of nodes
58
56
  test_files: []
59
57
  has_rdoc: