[Do not merge] WIP/Adding result json output file#172
[Do not merge] WIP/Adding result json output file#172vinay-satish wants to merge 1 commit intomainfrom
Conversation
lib/chef/knife/ec_backup.rb
Outdated
|
|
||
| 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.
| $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.
(Maybe we should ask Marc)
lib/chef/knife/ec_backup.rb
Outdated
|
|
||
| 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.
| $organizations_hash["total"]=$organizations_hash["total"]+1 | |
| $organizations_hash["total"]+=1 |
Shorter and more idiomatic.
lib/chef/knife/ec_backup.rb
Outdated
| end | ||
|
|
||
| def download_user(username, url) | ||
| $users_hash["total"]=$users_hash["total"]+1 |
There was a problem hiding this comment.
| $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.
| $users_hash["success_count"]=$users_hash["success_count"]+1 | |
| $users_hash["success_count"]+=1 |
lib/chef/knife/ec_backup.rb
Outdated
| end | ||
|
|
||
| def download_user_acl(username) | ||
| $user_acls_hash["total"]=$user_acls_hash["total"]+1 |
There was a problem hiding this comment.
| $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.
| $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!
|
|
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 |
| end No newline at end of file | ||
| gem "chef", "~> 17" | ||
| gem "ohai", "~> 17" | ||
| gem "knife", "~> 17" |
There was a problem hiding this comment.
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: