Skip to content

Commit

Permalink
Merge pull request #421 from SUSE/fix-failing-registered
Browse files Browse the repository at this point in the history
Fix failing on registered system without arguments
  • Loading branch information
gionaufal committed Aug 7, 2019
2 parents 9bc7691 + ca6c062 commit eaa58be
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion PACKAGE.md
Expand Up @@ -75,7 +75,7 @@ Please consult the corresponding [OBS page](https://build.opensuse.org/package/s

## Step 6. Committing the package

To submit the package:
After the PR is approved, to submit the package:
```bash
cd package
osc status
Expand Down
2 changes: 1 addition & 1 deletion lib/suse/connect/cli.rb
Expand Up @@ -42,7 +42,7 @@ def execute! # rubocop:disable MethodLength, CyclomaticComplexity, PerceivedComp
elsif @config.token && @config.instance_data_file
log.error 'Please use either --regcode or --instance-data'
exit(1)
elsif @config.url_default? && !@config.token && !status.activated_base_product?
elsif @config.url_default? && !@config.token && !@config.product
puts @opts
exit(1)
else
Expand Down
2 changes: 1 addition & 1 deletion lib/suse/connect/version.rb
@@ -1,5 +1,5 @@
module SUSE
module Connect
VERSION = '0.3.18'
VERSION = '0.3.19'
end
end
6 changes: 6 additions & 0 deletions package/SUSEConnect.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 7 10:15:21 UTC 2019 - Giovanni Filippetti <giovanni.filippetti@suse.com>

- Update to 0.3.19
- Fix failing on registered system without arguments (bsc#1144020)

-------------------------------------------------------------------
Wed May 29 13:15:05 UTC 2019 - Ivan Kapelyukhin <ikapelyukhin@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/SUSEConnect.spec
Expand Up @@ -17,7 +17,7 @@


Name: SUSEConnect
Version: 0.3.18
Version: 0.3.19
Release: 0
%define mod_name suse-connect
%define mod_full_name %{mod_name}-%{version}
Expand Down
7 changes: 6 additions & 1 deletion spec/connect/cli_spec.rb
Expand Up @@ -119,7 +119,6 @@

context 'when the system has no activated base product' do
it 'shows a properly rendered help page' do
expect_any_instance_of(Status).to receive(:activated_base_product?).and_return(false)
expect_any_instance_of(Client).not_to receive(:register!)
expect_any_instance_of(described_class).to receive(:puts) do |option_parser|
expect(option_parser.instance_variable_get(:@opts).to_s.split("\n").map(&:length)).to all be <= 80
Expand All @@ -139,6 +138,12 @@
expect_any_instance_of(SUSE::Connect::Config).to receive(:write!)
cli.execute!
end

it 'registers the system if using a configured proxy' do
allow_any_instance_of(SUSE::Connect::Config).to receive(:url_default?).and_return(false)
expect_any_instance_of(Client).to receive(:register!)
cli.execute!
end
end

it 'requires either --regcode or --url (regcode-less SMT registration) but respects config attributes' do
Expand Down

0 comments on commit eaa58be

Please sign in to comment.