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 +4 -4
- data/History.rdoc +9 -0
- data/lib/syncwrap/base.rb +1 -1
- data/lib/syncwrap/change_key_listener.rb +1 -1
- data/lib/syncwrap/systemd.rb +6 -2
- data/lib/syncwrap/systemd_service.rb +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22a464519cfbd5ea6bc08d068564183bb5ae8ffb
|
4
|
+
data.tar.gz: 3abda4ace0b737c72a7da35fbf37edbfda6748ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/lib/syncwrap/systemd.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
11
|
+
date: 2016-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|