-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Do not merge] WIP/Adding result json output file #172
base: main
Are you sure you want to change the base?
Conversation
lib/chef/knife/ec_backup.rb
Outdated
@@ -91,11 +98,13 @@ def for_each_user | |||
|
|||
def for_each_organization | |||
rest.get('/organizations').each_pair do |name, url| | |||
$organizations_hash["total"]=$organizations_hash["total"]+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$organizations_hash["total"]=$organizations_hash["total"]+1 | |
next unless (config[:org].nil? || config[:org] == name) | |
$organizations_hash["total"]=$organizations_hash["total"]+1 |
I'm not sure, but do we want this instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Maybe we should ask Marc)
lib/chef/knife/ec_backup.rb
Outdated
@@ -91,11 +98,13 @@ def for_each_user | |||
|
|||
def for_each_organization | |||
rest.get('/organizations').each_pair do |name, url| | |||
$organizations_hash["total"]=$organizations_hash["total"]+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$organizations_hash["total"]=$organizations_hash["total"]+1 | |
$organizations_hash["total"]+=1 |
Shorter and more idiomatic.
lib/chef/knife/ec_backup.rb
Outdated
@@ -115,18 +124,24 @@ def for_each_organization | |||
end | |||
|
|||
def download_user(username, url) | |||
$users_hash["total"]=$users_hash["total"]+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$users_hash["total"]=$users_hash["total"]+1 | |
$users_hash["total"]+=1 |
lib/chef/knife/ec_backup.rb
Outdated
File.open("#{dest_dir}/users/#{username}.json", 'w') do |file| | ||
file.write(Chef::JSONCompat.to_json_pretty(rest.get(url))) | ||
end | ||
$users_hash["success_count"]=$users_hash["success_count"]+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$users_hash["success_count"]=$users_hash["success_count"]+1 | |
$users_hash["success_count"]+=1 |
lib/chef/knife/ec_backup.rb
Outdated
knife_ec_error_handler.add(ex) | ||
end | ||
|
||
def download_user_acl(username) | ||
$user_acls_hash["total"]=$user_acls_hash["total"]+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$user_acls_hash["total"]=$user_acls_hash["total"]+1 | |
$user_acls_hash["total"]+=1 |
lib/chef/knife/ec_backup.rb
Outdated
File.open("#{dest_dir}/user_acls/#{username}.json", 'w') do |file| | ||
file.write(Chef::JSONCompat.to_json_pretty(user_acl_rest.get("users/#{username}/_acl"))) | ||
end | ||
$user_acls_hash["success_count"]=$user_acls_hash["success_count"]+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$user_acls_hash["success_count"]=$user_acls_hash["success_count"]+1 | |
$user_acls_hash["success_count"]+=1 |
Signed-off-by: Vinay Satish <vinay.satish@progress.com>
ed9fc04
to
6650d51
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Is this acceptance criteria being satisfied for this PR, or is there another PR?
|
It looks like the verify pipeline has some failures. |
Do not merge until chef/chef#13107 is merged and Gemfile.lock is updated to point to the new chef/chef |
gem "chef", "~> 17" | ||
gem "ohai", "~> 17" | ||
gem "knife", "~> 17" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well bump all of these to chef-18, this would be a major gem bump for knife-ec-backup.
Signed-off-by: Vinay Satish vinay.satish@progress.com
Description
Related Issue
Types of changes
Checklist: