lib/onering/cli/devices.rb in onering-client-0.0.86 vs lib/onering/cli/devices.rb in onering-client-0.0.87

- old
+ new

@@ -25,11 +25,11 @@ when :show return @api.devices.show(args[0]) # ----------------------------------------------------------------------------- when :get - Onering::Logger.fatal("Expected 1 parameter, got #{args.length}") unless args.length == 1 + Onering::Logger.fatal!("Expected 1 parameter, got #{args.length}", "Onering::CLI::Devices") unless args.length == 1 if @opts[:query_given] # doing this until a bulk field query endpoint is built return @api.list('id', { :filter => @opts[:query] @@ -40,11 +40,11 @@ end # ----------------------------------------------------------------------------- when :set - Onering::Logger.fatal("Expected 2 parameters, got #{args.length}") unless args.length == 2 + Onering::Logger.fatal!("Expected 2 parameters, got #{args.length}", "Onering::CLI::Devices") unless args.length == 2 if @opts[:query] # doing this until a bulk field set endpoint is built return @api.list('id', { :filter => @opts[:query] @@ -55,18 +55,18 @@ end # ----------------------------------------------------------------------------- when :list - Onering::Logger.fatal("Expected 1 parameter, got #{args.length}") unless args.length >= 1 + Onering::Logger.fatal!("Expected 1 parameter, got #{args.length}", "Onering::CLI::Devices") unless args.length >= 1 return @api.list(args[0], { :filter => [@opts[:query], args[1]].compact.join('/') }.compact) # ----------------------------------------------------------------------------- when :find - Onering::Logger.fatal("Expected 1 parameter, got #{args.length}") unless args.length == 1 + Onering::Logger.fatal!("Expected 1 parameter, got #{args.length}", "Onering::CLI::Devices") unless args.length == 1 return @api.find(args[0]) # ----------------------------------------------------------------------------- when :save rv = @api.save(args[0] || @opts[:id]) do @@ -77,16 +77,16 @@ # read from specified file elsif (File.readable?(args[1]) rescue false) File.read(args[1]) else - Onering::Logger.fatal("Cannot save data, no input data specified") + Onering::Logger.fatal!("Cannot save data, no input data specified", "Onering::CLI::Devices") end end rv.parsed_response else - Onering::Logger.fatal("Unknown subcommand #{sc.inspect}") + Onering::Logger.fatal!("Unknown subcommand #{sc.inspect}", "Onering::CLI::Devices") end end end end end \ No newline at end of file