Class: KnifeTopo::TopoCookbookUpload
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- KnifeTopo::TopoCookbookUpload
- Includes:
- Loader
- Defined in:
- lib/chef/knife/topo_cookbook_upload.rb
Overview
knife topo cookbook upload
Instance Attribute Summary
Attributes included from Loader
Instance Method Summary collapse
-
#initialize(args) ⇒ TopoCookbookUpload
constructor
A new instance of TopoCookbookUpload.
- #run ⇒ Object
- #validate_args ⇒ Object
Methods included from Loader
#auto_detect_format, #check_file, #create_topo_bag, #get_local_topo_path, #list_topo_bag, #load_local_topo_or_exit, #load_node_data, #load_topo_from_file_or_exit, #load_topo_from_server, #load_topo_from_server_or_exit, #priority_attrs, #topo_bag_name, #topologies_path
Constructor Details
#initialize(args) ⇒ TopoCookbookUpload
Returns a new instance of TopoCookbookUpload.
45 46 47 48 49 50 51 |
# File 'lib/chef/knife/topo_cookbook_upload.rb', line 45 def initialize(args) super @args = args # All called commands need to accept union of options Chef::Knife::CookbookUpload. = end |
Instance Method Details
#run ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/chef/knife/topo_cookbook_upload.rb', line 53 def run validate_args # Load the topology data @topo = load_local_topo_or_exit(@topo_name) # Run cookbook upload command on the topology cookbook @processor = KnifeTopo::Processor.for_topo(@topo) @processor.upload_artifacts('cmd' => self, 'cmd_args' => @args) end |
#validate_args ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/chef/knife/topo_cookbook_upload.rb', line 64 def validate_args unless @name_args[0] show_usage ui.fatal('You must specify the name of a topology') exit 1 end @topo_name = @name_args[0] end |