lib/onering/cli/devices.rb in onering-client-0.0.83 vs lib/onering/cli/devices.rb in onering-client-0.0.84

- old
+ new

@@ -25,11 +25,11 @@ when :show return @api.devices.show(args[0]) # ----------------------------------------------------------------------------- when :get - raise "Expected 1 parameter, got #{args.length}" unless args.length == 1 + Onering::Logger.fatal("Expected 1 parameter, got #{args.length}") 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 - raise "Expected 2 parameters, got #{args.length}" unless args.length == 2 + Onering::Logger.fatal("Expected 2 parameters, got #{args.length}") 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 - raise "Expected 1 parameter, got #{args.length}" unless args.length >= 1 + Onering::Logger.fatal("Expected 1 parameter, got #{args.length}") unless args.length >= 1 return @api.list(args[0], { :filter => [@opts[:query], args[1]].compact.join('/') }.compact) # ----------------------------------------------------------------------------- when :find - raise "Expected 1 parameter, got #{args.length}" unless args.length == 1 + Onering::Logger.fatal("Expected 1 parameter, got #{args.length}") 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 - raise "Cannot save data, no input data specified" + Onering::Logger.fatal("Cannot save data, no input data specified") end end rv.parsed_response else - raise "Unknown subcommand #{sc.inspect}" + Onering::Logger.fatal("Unknown subcommand #{sc.inspect}") end end end end end \ No newline at end of file