jss-api 0.5.6 → 0.5.7
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.
- data/CHANGES.md +12 -0
- data/lib/jss-api.rb +3 -0
- data/lib/jss-api/api_connection.rb +1 -1
- data/lib/jss-api/api_object/mobile_device.rb +1 -1
- data/lib/jss-api/api_object/package.rb +5 -6
- data/lib/jss-api/configuration.rb +4 -1
- data/lib/jss-api/db_connection.rb +6 -2
- data/lib/jss-api/version.rb +1 -1
- metadata +78 -84
data/CHANGES.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Change History
|
2
2
|
|
3
|
+
v0.5.7 2015-05-26
|
4
|
+
bugfixes & cleanup
|
5
|
+
- JSS.to_s_and_a now properly converts nils to "" and []
|
6
|
+
- DBConnection.connect gracefully handle reconnecting if the old connection went away
|
7
|
+
- DBConnection.connect, and APIConnection.connect: include server name when prompting for password
|
8
|
+
- Configuration: handle lack of ENV['HOME'] when trying to expand ~ to locate user-level config file.
|
9
|
+
- MobileDevice#unmanage_device: send_mdm_command is a class method, not an instance method
|
10
|
+
- APIObject: auto-set @site and @category if applicable
|
11
|
+
- Package: os_requirements default to empty array if unset in JSS
|
12
|
+
- Package#required_processor: remove buggy line of ancient, deprecated code
|
13
|
+
- Package#upload_master_file: move autoupdate to appropriate location
|
14
|
+
|
3
15
|
v0.5.6 2014-11-04
|
4
16
|
- now requires Ruby >= 1.9.3 and rest-client >= 1.7.0. Needed for Casper >= 9.61's lack of support for SSLv3.
|
5
17
|
- APIConnection now accepts :ssl_version option in the argument hash. Defaults to 'TLSv1'
|
data/lib/jss-api.rb
CHANGED
@@ -182,7 +182,7 @@ module JSS
|
|
182
182
|
args[:verify_ssl] = (args[:verify_cert].nil? or args[:verify_cert]) ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
|
183
183
|
|
184
184
|
args[:password] = if args[:pw] == :prompt
|
185
|
-
JSS.prompt_for_password "Enter the password for JSS user
|
185
|
+
JSS.prompt_for_password "Enter the password for JSS user #{args[:user]}@#{args[:server]}:"
|
186
186
|
elsif args[:pw].is_a?(Symbol) and args[:pw].to_s.start_with?('stdin')
|
187
187
|
args[:pw].to_s =~ /^stdin(\d+)$/
|
188
188
|
line = $1
|
@@ -180,6 +180,8 @@ module JSS
|
|
180
180
|
@install_if_reported_available = @init_data[:install_if_reported_available]
|
181
181
|
@notes = @init_data[:notes]
|
182
182
|
@os_requirements = @init_data[:os_requirements].split(/\s*,\s*/) if @init_data[:os_requirements]
|
183
|
+
@os_requirements ||= []
|
184
|
+
|
183
185
|
@priority = @init_data[:priority] || DEFAULT_PRIORITY
|
184
186
|
@reboot_required = @init_data[:reboot_required]
|
185
187
|
@required_processor = @init_data[:required_processor] || DEFAULT_CPU_TYPE
|
@@ -423,7 +425,6 @@ module JSS
|
|
423
425
|
###
|
424
426
|
def required_processor= (new_val)
|
425
427
|
return nil if new_val == @required_processor
|
426
|
-
new_val = validate_for_server(:required_processor => new_val)[:required_processor]
|
427
428
|
|
428
429
|
new_val = DEFAULT_PROCESSOR if new_val.to_s.empty?
|
429
430
|
raise JSS::InvalidDataError, "Required_processor must be one of: #{CPU_TYPES.join ', '}" unless CPU_TYPES.include? new_val
|
@@ -533,13 +534,11 @@ module JSS
|
|
533
534
|
local_path = zipfile
|
534
535
|
|
535
536
|
self.filename = zipfile.basename.to_s
|
536
|
-
|
537
|
+
|
537
538
|
end # if directory
|
538
|
-
|
539
|
-
|
540
|
-
|
539
|
+
self.update
|
541
540
|
FileUtils.copy_entry local_path, destination
|
542
|
-
|
541
|
+
|
543
542
|
mdp.unmount if unmount
|
544
543
|
end # upload
|
545
544
|
|
@@ -105,7 +105,7 @@ module JSS
|
|
105
105
|
GLOBAL_CONF = Pathname.new "/etc/#{CONF_FILE}"
|
106
106
|
|
107
107
|
### The Pathname to the user-specific preferences plist
|
108
|
-
USER_CONF = Pathname.new("~/.#{CONF_FILE}").expand_path
|
108
|
+
USER_CONF = ENV["HOME"] ? Pathname.new("~/.#{CONF_FILE}").expand_path : nil
|
109
109
|
|
110
110
|
### The attribute keys we maintain, and the type they should be stored as
|
111
111
|
CONF_KEYS = {
|
@@ -184,6 +184,7 @@ module JSS
|
|
184
184
|
### @return [void]
|
185
185
|
###
|
186
186
|
def read_user
|
187
|
+
return unless USER_CONF
|
187
188
|
read USER_CONF if USER_CONF.file? and USER_CONF.readable?
|
188
189
|
end
|
189
190
|
|
@@ -221,6 +222,8 @@ module JSS
|
|
221
222
|
else Pathname.new(file)
|
222
223
|
end
|
223
224
|
|
225
|
+
raise JSS::MissingDataError, "No HOME environment variable, can't write to user conf file." if path.nil?
|
226
|
+
|
224
227
|
# file already exists? read it in and update the values.
|
225
228
|
if path.readable?
|
226
229
|
data = path.read
|
@@ -163,7 +163,11 @@ module JSS
|
|
163
163
|
args[:socket] ||= DFT_SOCKET
|
164
164
|
args[:db_name] ||= DEFAULT_DB_NAME
|
165
165
|
|
166
|
-
|
166
|
+
begin
|
167
|
+
@mysql.close if connected?
|
168
|
+
rescue Mysql::ClientError::ServerGoneError
|
169
|
+
@connected = false
|
170
|
+
end
|
167
171
|
|
168
172
|
@server = args[:server]
|
169
173
|
@port = args[:port]
|
@@ -181,7 +185,7 @@ module JSS
|
|
181
185
|
raise JSS::MissingDataError, "Missing :pw (or :prompt/:stdin) for user '#{@user}'" unless args[:pw]
|
182
186
|
|
183
187
|
@pw = if args[:pw] == :prompt
|
184
|
-
JSS.prompt_for_password "Enter the password for the MySQL user
|
188
|
+
JSS.prompt_for_password "Enter the password for the MySQL user #{@user}@#{args[:server]}:"
|
185
189
|
elsif args[:pw].is_a?(Symbol) and args[:pw].to_s.start_with?('stdin')
|
186
190
|
args[:pw].to_s =~ /^stdin(\d+)$/
|
187
191
|
line = $1
|
data/lib/jss-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,93 +1,97 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jss-api
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.7
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 6
|
10
|
-
version: 0.5.6
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Chris Lasell
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: plist
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
32
22
|
type: :runtime
|
33
|
-
version_requirements: *id001
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: ruby-mysql
|
36
23
|
prerelease: false
|
37
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: ruby-mysql
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
38
33
|
none: false
|
39
|
-
requirements:
|
40
|
-
- -
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
version: "0"
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
46
38
|
type: :runtime
|
47
|
-
version_requirements: *id002
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: rest-client
|
50
39
|
prerelease: false
|
51
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rest-client
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
52
49
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
hash: 11
|
57
|
-
segments:
|
58
|
-
- 1
|
59
|
-
- 7
|
60
|
-
- 0
|
50
|
+
requirements:
|
51
|
+
- - '>='
|
52
|
+
- !ruby/object:Gem::Version
|
61
53
|
version: 1.7.0
|
62
54
|
type: :runtime
|
63
|
-
version_requirements: *id003
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
|
-
name: net-ldap
|
66
55
|
prerelease: false
|
67
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.7.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: net-ldap
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
68
65
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
segments:
|
74
|
-
- 0
|
75
|
-
version: "0"
|
66
|
+
requirements:
|
67
|
+
- - '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
76
70
|
type: :runtime
|
77
|
-
|
78
|
-
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: |2
|
79
|
+
The jss-api gem provides the JSS module, a framework for interacting with the REST API of the
|
80
|
+
JAMF Software Server (JSS), the core of the Casper Suite, an enterprise/education
|
81
|
+
tool for managing Apple devices, from JAMF Software LLC.
|
82
|
+
JSS API objects are implemented as Ruby classes, and interact with each oher to
|
83
|
+
allow simpler automation of Casper-related tasks. For details see the README file."
|
79
84
|
email: jss-api-gem@pixar.com
|
80
|
-
executables:
|
85
|
+
executables:
|
81
86
|
- cgrouper
|
82
87
|
- subnet-update
|
83
88
|
extensions: []
|
84
|
-
|
85
|
-
extra_rdoc_files:
|
89
|
+
extra_rdoc_files:
|
86
90
|
- README.md
|
87
91
|
- LICENSE.txt
|
88
92
|
- CHANGES.md
|
89
93
|
- THANKS.md
|
90
|
-
files:
|
94
|
+
files:
|
91
95
|
- lib/jss-api/api_connection.rb
|
92
96
|
- lib/jss-api/api_object/advanced_search/advanced_computer_search.rb
|
93
97
|
- lib/jss-api/api_object/advanced_search/advanced_mobile_device_search.rb
|
@@ -158,44 +162,34 @@ files:
|
|
158
162
|
- bin/cgrouper
|
159
163
|
- bin/subnet-update
|
160
164
|
homepage: http://pixaranimationstudios.github.io/jss-api-gem/
|
161
|
-
licenses:
|
165
|
+
licenses:
|
162
166
|
- Modified Apache-2.0
|
163
167
|
post_install_message:
|
164
|
-
rdoc_options:
|
168
|
+
rdoc_options:
|
165
169
|
- --title
|
166
170
|
- JSS
|
167
171
|
- --line-numbers
|
168
172
|
- --main
|
169
173
|
- README.md
|
170
|
-
require_paths:
|
174
|
+
require_paths:
|
171
175
|
- lib
|
172
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
176
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
173
177
|
none: false
|
174
|
-
requirements:
|
175
|
-
- -
|
176
|
-
- !ruby/object:Gem::Version
|
177
|
-
hash: 53
|
178
|
-
segments:
|
179
|
-
- 1
|
180
|
-
- 9
|
181
|
-
- 3
|
178
|
+
requirements:
|
179
|
+
- - '>='
|
180
|
+
- !ruby/object:Gem::Version
|
182
181
|
version: 1.9.3
|
183
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
184
183
|
none: false
|
185
|
-
requirements:
|
186
|
-
- -
|
187
|
-
- !ruby/object:Gem::Version
|
188
|
-
|
189
|
-
segments:
|
190
|
-
- 0
|
191
|
-
version: "0"
|
184
|
+
requirements:
|
185
|
+
- - '>='
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
192
188
|
requirements: []
|
193
|
-
|
194
189
|
rubyforge_project:
|
195
190
|
rubygems_version: 1.8.25
|
196
191
|
signing_key:
|
197
192
|
specification_version: 3
|
198
193
|
summary: A Ruby interface to the Casper Suite's JSS API
|
199
194
|
test_files: []
|
200
|
-
|
201
195
|
has_rdoc: true
|