summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsnehaldwivedi <sdwivedi@msystechnologies.com>2020-08-06 06:36:57 -0700
committersnehaldwivedi <sdwivedi@msystechnologies.com>2021-03-25 06:26:26 -0700
commit546b6d9acc8113397da7ec3848188c98898157f9 (patch)
tree2b0ec032e2d4c89063970c78d6aa6a765cc1bac0
parent6ef28f16233d10baacad47cc11afb4b71f6bb3af (diff)
downloadchef-546b6d9acc8113397da7ec3848188c98898157f9.tar.gz
Updated reviewed changes for copyrights and roo_rest
Signed-off-by: snehaldwivedi <sdwivedi@msystechnologies.com>
-rw-r--r--lib/chef/knife/org_delete.rb1
-rw-r--r--lib/chef/knife/org_list.rb3
-rw-r--r--lib/chef/knife/user_delete.rb3
-rw-r--r--lib/chef/knife/user_edit.rb2
-rw-r--r--lib/chef/knife/user_list.rb2
-rw-r--r--lib/chef/knife/user_show.rb3
-rw-r--r--spec/unit/knife/org_delete_spec.rb2
-rw-r--r--spec/unit/knife/org_list_spec.rb4
-rw-r--r--spec/unit/knife/org_show_spec.rb2
-rw-r--r--spec/unit/knife/user_create_spec.rb1
-rw-r--r--spec/unit/knife/user_delete_spec.rb2
-rw-r--r--spec/unit/knife/user_edit_spec.rb2
-rw-r--r--spec/unit/knife/user_show_spec.rb2
13 files changed, 14 insertions, 15 deletions
diff --git a/lib/chef/knife/org_delete.rb b/lib/chef/knife/org_delete.rb
index 340f6c529a..842354c947 100644
--- a/lib/chef/knife/org_delete.rb
+++ b/lib/chef/knife/org_delete.rb
@@ -24,6 +24,7 @@ class Chef
def run
org_name = @name_args[0]
+ org = Chef::Org.new(org_name)
ui.confirm "Do you want to delete the organization #{org_name}"
ui.output root_rest.delete("organizations/#{org_name}")
end
diff --git a/lib/chef/knife/org_list.rb b/lib/chef/knife/org_list.rb
index 6f1c4b582b..85a49ee4c5 100644
--- a/lib/chef/knife/org_list.rb
+++ b/lib/chef/knife/org_list.rb
@@ -1,6 +1,6 @@
#
# Author:: Steven Danna (<steve@chef.io>)
-# Copyright:: Copyright 2011-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
class Chef
class Knife
class OrgList < Knife
diff --git a/lib/chef/knife/user_delete.rb b/lib/chef/knife/user_delete.rb
index a5554cdd61..33a64ffefa 100644
--- a/lib/chef/knife/user_delete.rb
+++ b/lib/chef/knife/user_delete.rb
@@ -1,6 +1,6 @@
#
# Author:: Steven Danna (<steve@chef.io>)
-# Copyright:: Copyright 2011-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,6 +24,7 @@ class Chef
deps do
require_relative "../org"
+ require_relative "../user_v1"
end
banner "knife user delete USER (options)"
diff --git a/lib/chef/knife/user_edit.rb b/lib/chef/knife/user_edit.rb
index 88202fc81f..fff8c6b70f 100644
--- a/lib/chef/knife/user_edit.rb
+++ b/lib/chef/knife/user_edit.rb
@@ -1,6 +1,6 @@
#
# Author:: Steven Danna (<steve@chef.io>)
-# Copyright:: Copyright 2011-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/chef/knife/user_list.rb b/lib/chef/knife/user_list.rb
index 03b46a9f2a..3284964a47 100644
--- a/lib/chef/knife/user_list.rb
+++ b/lib/chef/knife/user_list.rb
@@ -1,6 +1,6 @@
#
# Author:: Steven Danna (<steve@chef.io>)
-# Copyright:: Copyright 2011-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/chef/knife/user_show.rb b/lib/chef/knife/user_show.rb
index 90097df339..ea2b06b753 100644
--- a/lib/chef/knife/user_show.rb
+++ b/lib/chef/knife/user_show.rb
@@ -1,6 +1,6 @@
#
# Author:: Steven Danna (<steve@chef.io>)
-# Copyright:: Copyright 2011-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,7 +30,6 @@ class Chef
long: "--with-orgs",
short: "-l"
-
def run
@user_name = @name_args[0]
diff --git a/spec/unit/knife/org_delete_spec.rb b/spec/unit/knife/org_delete_spec.rb
index b8fb372585..baa102f8c8 100644
--- a/spec/unit/knife/org_delete_spec.rb
+++ b/spec/unit/knife/org_delete_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Snehal Dwivedi (<sdwivedi@msystechnologies.com>)
-# Copyright:: Copyright 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/knife/org_list_spec.rb b/spec/unit/knife/org_list_spec.rb
index 0676f64ccc..de77b4b0c7 100644
--- a/spec/unit/knife/org_list_spec.rb
+++ b/spec/unit/knife/org_list_spec.rb
@@ -31,9 +31,7 @@ describe Chef::Knife::OrgList do
end
before :each do
- @rest = double("Chef::ServerAPI")
- allow(Chef::ServerAPI).to receive(:new).and_return(@rest)
- allow(@rest).to receive(:get).with("organizations").and_return(orgs)
+ @org = double("Chef::Org")
@knife = Chef::Knife::OrgList.new
expect(Chef::ServerAPI).to receive(:new).with(Chef::Config[:chef_server_root]).and_return(root_rest)
allow(root_rest).to receive(:get).with("organizations").and_return(orgs)
diff --git a/spec/unit/knife/org_show_spec.rb b/spec/unit/knife/org_show_spec.rb
index 01bdc34c3b..2f5246dd84 100644
--- a/spec/unit/knife/org_show_spec.rb
+++ b/spec/unit/knife/org_show_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Snehal Dwivedi (<sdwivedi@msystechnologies.com>)
-# Copyright:: Copyright 2011-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/knife/user_create_spec.rb b/spec/unit/knife/user_create_spec.rb
index c69a668f7e..157436bf36 100644
--- a/spec/unit/knife/user_create_spec.rb
+++ b/spec/unit/knife/user_create_spec.rb
@@ -204,7 +204,6 @@ describe Chef::Knife::UserCreate do
}
it "creates an user, associates a user, and adds it to the admins group" do
-
expect(root_rest).to receive(:post).with("organizations/ramsay/association_requests", request_body).and_return(@user)
expect(root_rest).to receive(:put).with("users/some_user/association_requests/1", { response: "accept" })
knife.run
diff --git a/spec/unit/knife/user_delete_spec.rb b/spec/unit/knife/user_delete_spec.rb
index a9916ad38c..64d9679895 100644
--- a/spec/unit/knife/user_delete_spec.rb
+++ b/spec/unit/knife/user_delete_spec.rb
@@ -1,5 +1,5 @@
#
-# # Copyright:: Copyright 2014-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/knife/user_edit_spec.rb b/spec/unit/knife/user_edit_spec.rb
index ddae25846e..2fde328c0c 100644
--- a/spec/unit/knife/user_edit_spec.rb
+++ b/spec/unit/knife/user_edit_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Steven Danna (<steve@chef.io>)
-# Copyright:: Copyright 2011-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/spec/unit/knife/user_show_spec.rb b/spec/unit/knife/user_show_spec.rb
index 0f674ea5dd..30742d8c21 100644
--- a/spec/unit/knife/user_show_spec.rb
+++ b/spec/unit/knife/user_show_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Steven Danna (<steve@chef.io>)
-# Copyright:: Copyright 2011-2016 Chef Software, Inc.
+# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");