linux_admin 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bf61e72eb74854665e5ffcd5a3301f8d4adf7b47
4
- data.tar.gz: '093787d03b9e5e257c1b8a4a51e2f1d5a2808700'
2
+ SHA256:
3
+ metadata.gz: 2eb1ce6c58d77a8b64d80d126f85a6fa82c101509aba2a2cbc3520c9665950b1
4
+ data.tar.gz: 838500eef5f901726c55bf63b21900e859a129968e5bde72792b0f278574ea21
5
5
  SHA512:
6
- metadata.gz: f9ba05b7aa256903fd6295fd6a69d23643314dd8228e03dbc14bc03b9df145640187705d1672a1c176a47be42f72131f6758a07ed81e664f63bc5794ea297b16
7
- data.tar.gz: 58105741a7dea22d59daebe727bebcd65bc3737c7dc02339b93968fccd57024ab6cf1a7d975b117686f82e08e651929ba940ab3b93d0dff187377e076d9a4f9b
6
+ metadata.gz: b89d8e1a0bfb0714af8f4fe09206ebb1b90f505d2ddd0472dbda7508a7c9d89fe8b0805792e02d4d2bf5e1a3fbb686c9f9da18cfb6eb2d4011b8286851859d8e
7
+ data.tar.gz: 6c17e878e9fa74ad1d4b884b905cc818ff0d842b705b361e264015c7cdc1a51f5e5372efcb3ed4d17741b5931f4f0761d6ab6a6666ee9c9de661fa97200ff985
@@ -17,7 +17,7 @@ module LinuxAdmin
17
17
  end
18
18
  end
19
19
 
20
- def registered?
20
+ def registered?(_options = nil)
21
21
  false
22
22
  end
23
23
 
@@ -5,7 +5,11 @@ module LinuxAdmin
5
5
  SATELLITE5_SERVER_CERT_PATH = "pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm"
6
6
  INSTALLED_SERVER_CERT_PATH = "/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT"
7
7
 
8
- def registered?
8
+ def initialize
9
+ warn("[DEPRECATION] 'LinuxAdmin::Rhn' is deprecated. Please use 'LinuxAdmin::SubscriptionManager' instead.")
10
+ end
11
+
12
+ def registered?(_options = nil)
9
13
  id = ""
10
14
  if File.exist?(systemid_file)
11
15
  xml = Nokogiri.XML(File.read(systemid_file))
@@ -15,8 +15,10 @@ module LinuxAdmin
15
15
  !!organizations(options)
16
16
  end
17
17
 
18
- def registered?
19
- Common.run("subscription-manager identity").exit_status == 0
18
+ def registered?(options = nil)
19
+ args = ["subscription-manager identity"]
20
+ args << {:params => proxy_params(options)} if options
21
+ Common.run(*args).exit_status.zero?
20
22
  end
21
23
 
22
24
  def refresh
@@ -1,3 +1,3 @@
1
1
  module LinuxAdmin
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.2.0".freeze
3
3
  end
@@ -28,9 +28,36 @@ describe LinuxAdmin::RegistrationSystem do
28
28
  end
29
29
  end
30
30
 
31
- it "#registered? when unregistered" do
32
- stub_registered_to_system(nil)
33
- expect(described_class.registered?).to be_falsey
31
+ context "#registered?" do
32
+ it "when unregistered" do
33
+ stub_registered_to_system(nil)
34
+ expect(described_class.registered?).to be_falsey
35
+ end
36
+
37
+ context "SubscriptionManager" do
38
+ it "with no args" do
39
+ expect(LinuxAdmin::Common).to receive(:run).with("subscription-manager identity").and_return(double(:exit_status => 0))
40
+
41
+ LinuxAdmin::SubscriptionManager.new.registered?
42
+ end
43
+
44
+ it "with a proxy" do
45
+ expect(LinuxAdmin::Common).to receive(:run).with(
46
+ "subscription-manager identity",
47
+ :params => {
48
+ "--proxy=" => "https://example.com",
49
+ "--proxyuser=" => "user",
50
+ "--proxypassword=" => "pass"
51
+ }
52
+ ).and_return(double(:exit_status => 0))
53
+
54
+ LinuxAdmin::SubscriptionManager.new.registered?(
55
+ :proxy_address => "https://example.com",
56
+ :proxy_username => "user",
57
+ :proxy_password => "pass"
58
+ )
59
+ end
60
+ end
34
61
  end
35
62
 
36
63
  context ".method_missing" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linux_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Dunne
@@ -23,7 +23,7 @@ authors:
23
23
  autorequire:
24
24
  bindir: bin
25
25
  cert_chain: []
26
- date: 2017-10-30 00:00:00.000000000 Z
26
+ date: 2017-12-06 00:00:00.000000000 Z
27
27
  dependencies:
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
@@ -320,7 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
320
320
  version: '0'
321
321
  requirements: []
322
322
  rubyforge_project:
323
- rubygems_version: 2.6.14
323
+ rubygems_version: 2.7.2
324
324
  signing_key:
325
325
  specification_version: 4
326
326
  summary: LinuxAdmin is a module to simplify management of linux systems.