Skip to content

Commit

Permalink
log the old credentials for easier debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jul 23, 2014
1 parent e3b87de commit 849cc6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/registration/sw_mgmt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,17 @@ def self.copy_old_credentials(source_dir)
log.info "Copying the old NCC credentials from previous installation"
log.info "Copying #{ncc_file} to #{new_file}"
::FileUtils.cp(ncc_file, new_file)

credentials = SUSE::Connect::Credentials.read(new_file)
log.info "Using previous NCC credentials: #{credentials.inspect}"
end

if File.exist?(scc_file)
log.info "Copying the old SCC credentials from previous installation"
log.info "Copying #{scc_file} to #{new_file}"
::FileUtils.cp(scc_file, new_file)
credentials = SUSE::Connect::Credentials.read(new_file)
log.info "Using previous SCC credentials: #{credentials.inspect}"
end
end

Expand Down
2 changes: 2 additions & 0 deletions test/sw_mgmt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@

expect(FileUtils).to receive(:cp).with(File.join(root_dir, target_dir, "NCCcredentials"),
File.join(target_dir, "SCCcredentials"))
expect(SUSE::Connect::Credentials).to receive(:read)

expect { Registration::SwMgmt.copy_old_credentials(root_dir) }.to_not raise_error
end
Expand All @@ -167,6 +168,7 @@

expect(FileUtils).to receive(:cp).with(File.join(root_dir, target_dir, "SCCcredentials"),
File.join(target_dir, "SCCcredentials"))
expect(SUSE::Connect::Credentials).to receive(:read)

expect { Registration::SwMgmt.copy_old_credentials(root_dir) }.to_not raise_error
end
Expand Down

0 comments on commit 849cc6e

Please sign in to comment.