Skip to content

Commit

Permalink
enable autorefresh for registered services (bnc#884937)
Browse files Browse the repository at this point in the history
- 3.1.81
  • Loading branch information
lslezak committed Jun 30, 2014
1 parent 3e6c7c0 commit eaa3b5f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package/yast2-registration.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jun 30 11:36:46 UTC 2014 - lslezak@suse.cz

- enable autorefresh for registered services (bnc#884937)
- 3.1.81

-------------------------------------------------------------------
Thu Jun 26 17:59:09 UTC 2014 - lslezak@suse.cz

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


Name: yast2-registration
Version: 3.1.80
Version: 3.1.81
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
5 changes: 5 additions & 0 deletions src/lib/registration/sw_mgmt.rb
Expand Up @@ -182,6 +182,11 @@ def self.add_service(product_service, credentials)
# error message
raise ::Registration::ServiceError.new(N_("Adding service '%s' failed."), service_name)
end

if !Pkg.ServiceSet(service_name, "autorefresh" => true)
# error message
raise ::Registration::ServiceError.new(N_("Updating service '%s' failed."), service_name)
end
end

# refresh works only for saved services
Expand Down
1 change: 1 addition & 0 deletions test/sw_mgmt_spec.rb
Expand Up @@ -118,6 +118,7 @@
it "it creates a new service if the service does not exist yet" do
expect(yast_pkg).to receive(:ServiceAliases).and_return([])
expect(yast_pkg).to receive(:ServiceAdd).with(service_name, service_url).and_return(true)
expect(yast_pkg).to receive(:ServiceSet).with(service_name, hash_including("autorefresh" => true)).and_return(true)
expect { Registration::SwMgmt.add_service(product_service, credentials) }.to_not raise_error
end

Expand Down

0 comments on commit eaa3b5f

Please sign in to comment.