linux_admin 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2eb1ce6c58d77a8b64d80d126f85a6fa82c101509aba2a2cbc3520c9665950b1
4
- data.tar.gz: 838500eef5f901726c55bf63b21900e859a129968e5bde72792b0f278574ea21
3
+ metadata.gz: a863d63cfccd0d251315f154912c9422cb7ca216cf324da353b073c659b115c8
4
+ data.tar.gz: 4187ad54595560e76bcfe08c8bdac09b2d430cd1e2b05d678b0f4173a5d1db09
5
5
  SHA512:
6
- metadata.gz: b89d8e1a0bfb0714af8f4fe09206ebb1b90f505d2ddd0472dbda7508a7c9d89fe8b0805792e02d4d2bf5e1a3fbb686c9f9da18cfb6eb2d4011b8286851859d8e
7
- data.tar.gz: 6c17e878e9fa74ad1d4b884b905cc818ff0d842b705b361e264015c7cdc1a51f5e5372efcb3ed4d17741b5931f4f0761d6ab6a6666ee9c9de661fa97200ff985
6
+ metadata.gz: 364f16b054e815863a566c502853b46e2001b48a91abb47f9557b8173459b58db3be7b45a6700c2ec190c3e54c9289688c42d83d65962833c1a7a20a7ef94e58
7
+ data.tar.gz: 46da4ef5979a2dd28ba4bd6195bffcb239d0b42b6a051e04110fb0e5b8a51db5dbec4faaed6e930d8d4a7640e9e3ab722f38467f7fb2a6e52f28e0af16d9c13e
@@ -7,5 +7,7 @@ module LinuxAdmin
7
7
 
8
8
  class NetworkInterfaceError < AwesomeSpawn::CommandResultError; end
9
9
 
10
+ class SubscriptionManagerError < AwesomeSpawn::CommandResultError; end
11
+
10
12
  class MissingConfigurationFileError < StandardError; end
11
13
  end
@@ -6,7 +6,7 @@ module LinuxAdmin
6
6
  Common.run!(cmd, options)
7
7
  rescue AwesomeSpawn::CommandResultError => err
8
8
  raise CredentialError.new(err.result) if err.result.error.downcase.include?("invalid username or password")
9
- raise
9
+ raise SubscriptionManagerError.new(err.message, err.result)
10
10
  end
11
11
 
12
12
  SATELLITE6_SERVER_CERT_PATH = "pub/katello-ca-consumer-latest.noarch.rpm"
@@ -1,3 +1,3 @@
1
1
  module LinuxAdmin
2
- VERSION = "1.2.0".freeze
2
+ VERSION = "1.2.1".freeze
3
3
  end
@@ -1,4 +1,22 @@
1
1
  describe LinuxAdmin::SubscriptionManager do
2
+ context "#run!" do
3
+ it "raises a CredentialError if the error message contained a credential error" do
4
+ result = AwesomeSpawn::CommandResult.new("stuff", "things", "invalid username or password", 1)
5
+ err = AwesomeSpawn::CommandResultError.new("things", result)
6
+ expect(LinuxAdmin::Common).to receive(:run!).and_raise(err)
7
+
8
+ expect { subject.run!("stuff") }.to raise_error(LinuxAdmin::CredentialError)
9
+ end
10
+
11
+ it "raises a SubscriptionManagerError if the error message does not contain a credential error" do
12
+ result = AwesomeSpawn::CommandResult.new("stuff", "things", "not a credential error", 1)
13
+ err = AwesomeSpawn::CommandResultError.new("things", result)
14
+ expect(LinuxAdmin::Common).to receive(:run!).and_raise(err)
15
+
16
+ expect { subject.run!("stuff") }.to raise_error(LinuxAdmin::SubscriptionManagerError)
17
+ end
18
+ end
19
+
2
20
  context "#registered?" do
3
21
  it "system with subscription-manager commands" do
4
22
  expect(LinuxAdmin::Common).to receive(:run).once.with("subscription-manager identity")
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.2.0
4
+ version: 1.2.1
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-12-06 00:00:00.000000000 Z
26
+ date: 2018-02-23 00:00:00.000000000 Z
27
27
  dependencies:
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
@@ -191,7 +191,7 @@ description: |2
191
191
  It should be a single place to manage various system level configurations,
192
192
  registration, updates, etc.
193
193
  email:
194
- - bdunne@redhat.com
194
+ - brandondunne@hotmail.com
195
195
  - fryguy9@gmail.com
196
196
  - mmorsi@redhat.com
197
197
  - jrafanie@redhat.com
@@ -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.7.2
323
+ rubygems_version: 2.7.6
324
324
  signing_key:
325
325
  specification_version: 4
326
326
  summary: LinuxAdmin is a module to simplify management of linux systems.