syncwrap 2.8.0 → 2.8.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
2
  SHA1:
3
- metadata.gz: 13c35dd94712da0efcf94baf546fe093c22ea98b
4
- data.tar.gz: 7ab95e5de09411aeebb0999611e04eda2380fe49
3
+ metadata.gz: 22a464519cfbd5ea6bc08d068564183bb5ae8ffb
4
+ data.tar.gz: 3abda4ace0b737c72a7da35fbf37edbfda6748ac
5
5
  SHA512:
6
- metadata.gz: 00008c83b2ef58df4ca10b2913257963d9f64cc3ca992f6838d8a9bd075f8863a52265115016e1c93585bff946da6ac324a9bc6bf673ff3af308be95a3a3866a
7
- data.tar.gz: b3c96fe0054c7011e05fb8bc858eaaab57dd08ea32ff0d9633fceddbce195bca6079d069fff7e9accfc3adb42a71ab37becf19f9bb25097cff80b1b4646fa7d0
6
+ metadata.gz: 2af276c549619ca49dd33d8b95b002fc5c1641136269f722dcb009d193cc2f98350982ff1075fbc2df7132a774d6d230005daede23bdad6e8e9aa52a3b3808ff
7
+ data.tar.gz: 957bdc9171f4987a1267664ee75282ef81bc5e5d076ce22a17e541c779d953488d6ade54fb3c3551c54e1343cb1fc17c0eb0a46be7cf40abc5c445fcb0b7c0a3
data/History.rdoc CHANGED
@@ -1,3 +1,12 @@
1
+ === 2.8.1 (2016-7-20)
2
+ * Add support for passing options to SyncWrap::SystemD#systemctl which
3
+ are passed though to sudo. Since systemctl returns non-zero for a
4
+ variety of normal conditions, the :accept option can be passed to
5
+ account for these.
6
+ * Accept commonplace (normal operations) exit codes 0-3 from
7
+ `systemctl` in SyncWrap::SystemDService#status
8
+ * Fix silly typo in SyncWrap::ChangeKeyListener
9
+
1
10
  === 2.8.0 (2016-7-19)
2
11
  * Only allow public component methods to be executed via the
3
12
  SyncWrap::Space#execute and thus the CLI. Previously it was possible
data/lib/syncwrap/base.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  #++
16
16
 
17
17
  module SyncWrap
18
- VERSION='2.8.0'
18
+ VERSION='2.8.1'
19
19
 
20
20
  GEM_ROOT = File.dirname(File.dirname(File.dirname(__FILE__))) # :nodoc:
21
21
  end
@@ -35,7 +35,7 @@ module SyncWrap
35
35
  def change_key_changes?
36
36
  Array( change_key ).any? do |k|
37
37
  c = state[ k ]
38
- c && !c.emtpy?
38
+ c && !c.empty?
39
39
  end
40
40
  end
41
41
 
@@ -19,9 +19,13 @@ module SyncWrap
19
19
  # Support module for the systemd service manager, PID 1
20
20
  module SystemD
21
21
 
22
- # Run systemd `systemctl` command with args via sudo as root.
22
+ # Run systemd `systemctl` command with args via sudo as root. A
23
+ # trailing hash is interpreted as options and passed to
24
+ # sudo. Since systemctl returns non-zero for a variety of normal
25
+ # conditions, the :accept option can be passed to account for these.
23
26
  def systemctl( *args )
24
- sudo "systemctl #{args.join ' '}"
27
+ opts = args.last.is_a?( Hash ) && args.pop || {}
28
+ sudo( "systemctl #{args.join ' '}", opts )
25
29
  end
26
30
 
27
31
  # Expand given shortname to "shortname.service" as used for the
@@ -105,10 +105,13 @@ module SyncWrap
105
105
  systemctl( 'stop', *systemd_units )
106
106
  end
107
107
 
108
- # Output status of #systemd_units (useful via CLI with --verbose)
108
+ # Output status of #systemd_units (useful via CLI with --verbose).
109
+ # Exit codes 0-3 are accepted from `systemctl`, since these will
110
+ # be returned in normal operational contexts, for example, when
111
+ # services are intentionally and manually stopped.
109
112
  def status
110
113
  require_systemd_service!
111
- systemctl( 'status', *systemd_units )
114
+ systemctl( 'status', *systemd_units, accept: [0,1,2,3] )
112
115
  end
113
116
 
114
117
  protected
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syncwrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Kellum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-19 00:00:00.000000000 Z
11
+ date: 2016-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor