linux_admin 1.0.0 → 1.0.1

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: 37ae200177745a8eee67b4ef34405212de3de4b7
4
- data.tar.gz: 34608da2633afe87941edc70e9e91d8b7b443f1c
2
+ SHA256:
3
+ metadata.gz: f0a9b1d0bd176283e9a4d0611e56c3b891699f6045ba164450cabf12676c3e54
4
+ data.tar.gz: 2922af28fd23935d3af3b697a025f02ff36c7651c203a5093057b6a2ce080fdc
5
5
  SHA512:
6
- metadata.gz: 0ce7cc837a7056db8ee5c2c5c82f64e61fb590c9bbeeaa10120f6477ece877a46ccc8f7f718961573ad391f53a88fc0942b3d2335b22807a7aa5f763140b44e2
7
- data.tar.gz: 1feb8d22f59567560c974958188f668b6fda4ee352b08c7a4dc84aff96b146e0b24411e09d1de32fc1382ee5becdf1bd81fa58ee68d7a93e4b28acf536a4c786
6
+ metadata.gz: 94bdbfe6c896dc488582134532f5a15a26c86076fb8351efc55b9c5c5617a78ab0cf2bfc6a8154e07df5c9acec44f659b3ade9080b91c8bfe66c50eec3092aa8
7
+ data.tar.gz: 7a1453c3a0e04d3d32d7a4ef9c4a585ec66547ed92529e19055947dd077befd6431b3d50edf3c094c3d75741053896b5bef313a484f208d71d708f2da2f6c8c1
@@ -5,7 +5,7 @@ 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 registered?(_options = nil)
9
9
  id = ""
10
10
  if File.exist?(systemid_file)
11
11
  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
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module LinuxAdmin
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "1.0.1".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.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Dunne
@@ -21,7 +21,7 @@ authors:
21
21
  autorequire:
22
22
  bindir: bin
23
23
  cert_chain: []
24
- date: 2017-10-03 00:00:00.000000000 Z
24
+ date: 2018-01-10 00:00:00.000000000 Z
25
25
  dependencies:
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: bundler
@@ -183,7 +183,7 @@ description: |2
183
183
  It should be a single place to manage various system level configurations,
184
184
  registration, updates, etc.
185
185
  email:
186
- - bdunne@redhat.com
186
+ - brandondunne@hotmail.com
187
187
  - fryguy9@gmail.com
188
188
  - mmorsi@redhat.com
189
189
  - jrafanie@redhat.com
@@ -310,7 +310,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
310
310
  version: '0'
311
311
  requirements: []
312
312
  rubyforge_project:
313
- rubygems_version: 2.6.13
313
+ rubygems_version: 2.7.2
314
314
  signing_key:
315
315
  specification_version: 4
316
316
  summary: LinuxAdmin is a module to simplify management of linux systems.