xolo-admin 2.2.2 → 2.2.4

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: 68e91c47fc2a8727a01783c335fc24826b93221151a2a020e34b2cc94b9558b3
4
- data.tar.gz: 79a97ef6351fcdef02429d1617d332335890b8ec19352f1d3dfba3b7031408bf
3
+ metadata.gz: c2b0f21f5f3a7a55117054a2fe5cd35e7e702debd3909669f969e009b603cbbe
4
+ data.tar.gz: 27f012b50a0986d7a06854f5cef89af6b549efe7a22b30faf3601418be3dc56d
5
5
  SHA512:
6
- metadata.gz: 29ff161a1fcd6368eba29865bb670c6e26b24c30ad48a9100d1c2449e4f9a6e321f850e127e3802b2fcf68f457160b41dec086650b4eddd6f15e93ee011b7e57
7
- data.tar.gz: faf10455d2f7ed6cba2de80a08b667911547faf1059ba1e1bc109656b4f4e7dbe3c59f73d6ceefb3f348370babfd69d881980e2acae7b71c4d7cbe9c45b4cbc5
6
+ metadata.gz: 854b8cf91c614184a51b2753931135dbb91d697965b5531859d886d96e554fcfb33c60abc141c47bb0748a4150cec8fa0d357a4cbfb4dbf44625b439229adf9a
7
+ data.tar.gz: bbcbf4275c621a79829d365b0a4d0bd4ac09775516efb924fbb4bd8f1f9039c17e0b1d8c2ce22293793ffbb83696e86b385cdd57fa2c41c6f706080c69bd1b2e
@@ -17,7 +17,7 @@ module Xolo
17
17
 
18
18
  include Singleton
19
19
 
20
- # Save to yaml file in ~/Library/Preferences/com.pixar.xolo.admin.prefs.yaml
20
+ # Save to yaml file in ~/Library/Preferences/com.pixar.xolo.admin.config.yaml
21
21
  #
22
22
  # - hostname of xolo server
23
23
  # - always port 443, for now
@@ -263,7 +263,30 @@ module Xolo
263
263
  desc: <<~ENDDESC
264
264
  Show only titles that are available for updates via Self Service. To see those with initial installation via Self Service, use --self-service.
265
265
  ENDDESC
266
+ },
267
+
268
+ released_to_all: {
269
+ label: 'Released to All',
270
+ cli: :A,
271
+ type: :boolean,
272
+ validate: :validate_boolean,
273
+ default: false,
274
+ desc: <<~ENDDESC
275
+ Show only titles that have --release-groups set to 'all'.
276
+ ENDDESC
277
+ },
278
+
279
+ version_scripts: {
280
+ label: 'Using Version Scripts',
281
+ cli: :v,
282
+ type: :boolean,
283
+ validate: :validate_boolean,
284
+ default: false,
285
+ desc: <<~ENDDESC
286
+ Show only titles that use a version script.
287
+ ENDDESC
266
288
  }
289
+
267
290
  }.freeze
268
291
 
269
292
  PATCH_REPORT_OPTIONS = {
@@ -37,6 +37,10 @@ module Xolo
37
37
  # the lack of sinatra and such.
38
38
  LOG_LEVELS = %w[debug info warn error fatal].freeze
39
39
 
40
+ INSTALL = 'Install'
41
+ UPDATE = 'Update'
42
+ INS_UPD = 'Ins & Upd'
43
+
40
44
  # Module Methods
41
45
  ##########################
42
46
  ##########################
@@ -191,8 +195,7 @@ module Xolo
191
195
  # @return [void]
192
196
  ###############################
193
197
  def update_config
194
- debug? && puts("DEBUG: opts_to_process: #{opts_to_process}")
195
-
198
+ show_debug "DEBUG: opts_to_process: #{opts_to_process}"
196
199
  # Xolo::Admin::Configuration::KEYS.each_key do |key|
197
200
  # config.send "#{key}=", opts_to_process[key]
198
201
  # end
@@ -221,6 +224,8 @@ module Xolo
221
224
  type ||= opts_to_process.managed ? ' managed' : nil
222
225
  autopkg = opts_to_process.autopkg ? ' autopkg' : nil
223
226
  pilots = opts_to_process.pilots ? ' with unreleased pilots' : nil
227
+ vscripts = opts_to_process.version_scripts ? ' with version scripts' : nil
228
+ to_all = opts_to_process.released_to_all ? ",\n# released to all non-excluded computers." : nil
224
229
 
225
230
  ssvc =
226
231
  if opts_to_process.self_service && opts_to_process.self_service_updates
@@ -231,26 +236,43 @@ module Xolo
231
236
  ' updated via Self Service'
232
237
  end
233
238
 
234
- report_title = "All#{type}#{autopkg} titles in Xolo#{pilots}#{ssvc}"
239
+ report_title = "All#{type}#{autopkg} titles in Xolo#{pilots}#{ssvc}#{vscripts}#{to_all}"
235
240
 
236
241
  titles.select!(&:subscribed?) if opts_to_process.subscribed
237
242
  titles.reject!(&:subscribed?) if opts_to_process.managed
238
243
  titles.select!(&:autopkg_recipe) if opts_to_process.autopkg
239
- titles.select! { |t| pending_pilots? t } if opts_to_process.pilots
240
244
  titles.select!(&:self_service?) if opts_to_process.self_service
241
245
  titles.select!(&:self_service_updates?) if opts_to_process.self_service_updates
242
246
 
243
- header = %w[Title Created By SSvc? Latest Released]
247
+ # pending_pilots is a local method, not a title attribute!
248
+ titles.select! { |t| pending_pilots? t } if opts_to_process.pilots
249
+ titles.select! { |t| t.release_groups.include? Xolo::TARGET_ALL } if opts_to_process.released_to_all
250
+ titles.reject! { |t| t.version_script.pix_empty? } if opts_to_process.version_scripts
251
+
252
+ header = %w[Title Created By SSvc Latest Released]
253
+
244
254
  data = titles.map do |t|
255
+ ssvc_disp =
256
+ if t.self_service && t.self_service_updates
257
+ INS_UPD
258
+ elsif t.self_service
259
+ INSTALL
260
+ elsif t.self_service_updates
261
+ UPDATE
262
+ else
263
+ Xolo::DASH
264
+ end
265
+
245
266
  [
246
267
  t.title,
247
268
  t.creation_date.to_date,
248
269
  t.created_by,
249
- t.self_service || false,
270
+ ssvc_disp,
250
271
  t.latest_version,
251
272
  t.released_version
252
273
  ]
253
274
  end
275
+
254
276
  data.sort_by! { |d| d[0].downcase } # sort by title
255
277
 
256
278
  show_text generate_report(data, header_row: header, title: report_title)
@@ -289,10 +311,8 @@ module Xolo
289
311
 
290
312
  response_data = new_title.add(server_cnx)
291
313
 
292
- if debug?
293
- puts "DEBUG: response_data: #{response_data}"
294
- puts
295
- end
314
+ show_debug "response_data: #{response_data}"
315
+
296
316
  if response_data[:progress_stream_url_path]
297
317
  display_progress response_data[:progress_stream_url_path]
298
318
  else
@@ -329,10 +349,7 @@ module Xolo
329
349
  title = Xolo::Admin::Title.new opts_to_process
330
350
  response_data = title.update server_cnx
331
351
 
332
- if debug?
333
- puts "DEBUG: response_data: #{response_data}"
334
- puts
335
- end
352
+ show_debug "response_data: #{response_data}"
336
353
 
337
354
  display_progress response_data[:progress_stream_url_path]
338
355
 
@@ -399,10 +416,7 @@ module Xolo
399
416
 
400
417
  response_data = Xolo::Admin::Title.delete cli_cmd.title, server_cnx
401
418
 
402
- if debug?
403
- puts "DEBUG: response_data: #{response_data}"
404
- puts
405
- end
419
+ show_debug "response_data: #{response_data}"
406
420
 
407
421
  display_progress response_data[:progress_stream_url_path]
408
422
 
@@ -427,10 +441,7 @@ module Xolo
427
441
  title = Xolo::Admin::Title.fetch cli_cmd.title, server_cnx
428
442
  response_data = title.freeze ARGV, cli_cmd_opts.users_given, server_cnx
429
443
 
430
- if debug?
431
- puts "DEBUG: response_data: #{response_data}"
432
- puts
433
- end
444
+ show_debug "response_data: #{response_data}"
434
445
 
435
446
  if json?
436
447
  puts JSON.pretty_generate(response_data)
@@ -452,10 +463,7 @@ module Xolo
452
463
  def list_frozen
453
464
  title = Xolo::Admin::Title.fetch cli_cmd.title, server_cnx
454
465
  frozen_computers = title.frozen server_cnx
455
- if debug?
456
- puts "DEBUG: response_data: #{frozen_computers}"
457
- puts
458
- end
466
+ show_debug "response_data: #{frozen_computers}"
459
467
 
460
468
  if json?
461
469
  puts JSON.pretty_generate(frozen_computers)
@@ -490,10 +498,7 @@ module Xolo
490
498
  title = Xolo::Admin::Title.fetch cli_cmd.title, server_cnx
491
499
  response_data = title.thaw ARGV, cli_cmd_opts.users_given, server_cnx
492
500
 
493
- if debug?
494
- puts "DEBUG: response_data: #{response_data}"
495
- puts
496
- end
501
+ show_debug "response_data: #{response_data}"
497
502
 
498
503
  if json?
499
504
  puts JSON.pretty_generate(response_data)
@@ -559,14 +564,13 @@ module Xolo
559
564
  new_vers = Xolo::Admin::Version.new opts_to_process
560
565
  response_data = new_vers.add(server_cnx)
561
566
 
562
- if debug?
563
- puts "DEBUG: response_data: #{response_data}"
564
- puts
565
- end
567
+ show_debug "response_data: #{response_data}"
566
568
 
567
569
  display_progress response_data[:progress_stream_url_path]
568
570
 
569
571
  # Upload the pkg, if any?
572
+ # for pkg creation, no upload if autopkg.
573
+ # but yes for edits.
570
574
  upload_pkg(new_vers) unless title_obj.autopkg_enabled?
571
575
 
572
576
  speak 'It can take up to 15 minutes for the version to be available for use. Please do not release it before then'
@@ -587,11 +591,16 @@ module Xolo
587
591
  # @return [void]
588
592
  ################################
589
593
  def upload_pkg(version)
590
- return unless version.pkg_to_upload.is_a? Pathname
594
+ unless version.pkg_to_upload.is_a? Pathname
595
+ show_debug "version.pkg_to_upload class: #{version.pkg_to_upload.class}"
596
+ return
597
+ end
591
598
 
592
- # TODO: deal with autopkg pkgs, should we be able to do this?
599
+ # pause a moment for the previous stream to end.
600
+ sleep 5
593
601
 
594
602
  speak "Uploading #{version.pkg_to_upload.basename}, #{version.pkg_to_upload.pix_humanize_size} to Xolo"
603
+
595
604
  # start the upload in a thread
596
605
  upload_thr = Thread.new { version.upload_pkg(upload_cnx) }
597
606
 
@@ -621,14 +630,12 @@ module Xolo
621
630
 
622
631
  response_data = vers.update server_cnx
623
632
 
624
- if debug?
625
- puts "DEBUG: response_data: #{response_data}"
626
- puts
627
- end
633
+ show_debug "response_data: #{response_data}"
628
634
 
629
635
  display_progress response_data[:progress_stream_url_path]
630
636
 
631
637
  # Upload the pkg, if any?
638
+ # speak 'Upload would happen here'
632
639
  upload_pkg(vers)
633
640
 
634
641
  speak "Version '#{cli_cmd.version}' of title '#{cli_cmd.title}' has been updated in Xolo."
@@ -691,10 +698,7 @@ module Xolo
691
698
 
692
699
  response_data = Xolo::Admin::Version.delete cli_cmd.title, cli_cmd.version, server_cnx
693
700
 
694
- if debug?
695
- puts "DEBUG: response_data: #{response_data}"
696
- puts
697
- end
701
+ show_debug "response_data: #{response_data}"
698
702
 
699
703
  display_progress response_data[:progress_stream_url_path]
700
704
  rescue StandardError => e
@@ -713,10 +717,7 @@ module Xolo
713
717
  title = Xolo::Admin::Title.new opts_to_process
714
718
  response_data = title.release server_cnx, version: cli_cmd.version
715
719
 
716
- if debug?
717
- puts "DEBUG: response_data: #{response_data}"
718
- puts
719
- end
720
+ show_debug "response_data: #{response_data}"
720
721
 
721
722
  display_progress response_data[:progress_stream_url_path]
722
723
  speak "Version '#{cli_cmd.version}' of Title '#{cli_cmd.title}' has been released."
@@ -865,10 +866,7 @@ module Xolo
865
866
  title = Xolo::Admin::Title.fetch cli_cmd.title, server_cnx
866
867
  response_data = title.repair server_cnx, versions: opts_to_process[:versions]
867
868
  end
868
- if debug?
869
- puts "DEBUG: response_data: #{response_data}"
870
- puts
871
- end
869
+ show_debug "response_data: #{response_data}"
872
870
 
873
871
  display_progress response_data[:progress_stream_url_path]
874
872
  rescue StandardError => e
@@ -1092,10 +1090,7 @@ module Xolo
1092
1090
  result = server_cnx.post(SERVER_SHUTDOWN_ROUTE, payload).body
1093
1091
  puts "result[:result] = #{result[:result]}"
1094
1092
 
1095
- if debug?
1096
- puts "DEBUG: response_data: #{result}"
1097
- puts
1098
- end
1093
+ show_debug "response_data: #{result}"
1099
1094
 
1100
1095
  display_progress result[:progress_stream_url_path]
1101
1096
 
@@ -33,7 +33,7 @@ module Xolo
33
33
  # Instance method #conf_file [Pathname]
34
34
  # The full expanded absolute path to the config yaml file.
35
35
  #
36
- # Constant KEYS [Hash{Symbol: Hash}]
36
+ # Constant KEYS [Hash {Symbol: Hash}]
37
37
  # The keys of this Hash are the keys that may be found in the yaml file.
38
38
  # The Hash values here define the value in the YAML file, with these keys:
39
39
  #
@@ -14,12 +14,9 @@ module Xolo
14
14
 
15
15
  module BaseClasses
16
16
 
17
- # The base class for dealing with Titles and Versions/Patches in the
18
- # Xolo Server, Admin, and Client modules.
19
- #
20
17
  # The base class for "xolo objects stored on the xolo server", i.e.
21
18
  # Titles and Versions/Patches - whether they are being used on the server,
22
- # in xadm, or in the client.
19
+ # or in xadm.
23
20
  #
24
21
  # This class holds stuff common to all no matter where or how they are used.
25
22
  #
@@ -15,12 +15,12 @@ module Xolo
15
15
  module BaseClasses
16
16
 
17
17
  # The base class for dealing with Titles in the
18
- # Xolo Server, Admin, and Client modules.
18
+ # Xolo Server & Admin modules.
19
19
  #
20
20
  # This class holds the common aspects of Xolo Titles as used
21
- # on the Xolo server, in the Xolo Admin CLI app 'xadm', and the
22
- # client app 'xolo' - most importately it defines which data they
23
- # exchange.
21
+ # on the Xolo server and in the Xolo Admin CLI app 'xadm'
22
+ # and the 'xolo' client app (as JSON data).
23
+ # - most importately it defines which data they exchange.
24
24
  #
25
25
  ############################
26
26
  class Title < Xolo::Core::BaseClasses::ServerObject
@@ -43,7 +43,7 @@ module Xolo
43
43
  #
44
44
  # This hash defines the common attributes of all Xolo titles - which should
45
45
  # be available in all subclasses, both on the server, in xadm, and via the
46
- # client.
46
+ # client (as JSON data).
47
47
  #
48
48
  # Each of those subclasses might define (and store or calculate) other
49
49
  # attributes as needed.
@@ -759,7 +759,7 @@ module Xolo
759
759
 
760
760
  By default this is false, Patch Policies for versions will be set to 'Install Automatically'.
761
761
 
762
- If set to true, Patch Policies for versions will be set to 'Make Available in Self Service' and the version will appear in the Updates section when available. The update won't happen until the user clicks a button, or the 7-day deadline passes. Notifications will be displayed daily.
762
+ If set to true, Patch Policies for versions will be set to 'Make Available in Self Service' and the version will appear in the Updates section when available. The update won't happen until the user clicks a button, or the 7-day deadline passes. Notifications will be displayed daily. For these titles, 'xolo update' will not apply the update, but 'xolo install <title>' will update/install the current release.
763
763
 
764
764
  When installing automatically, or the deadline passes, the update will happen at the checkin after the next recon. If the version has any KillApps, the user will be prompted to quit them, with a grace period of 15 minutes before the update starts.
765
765
 
@@ -966,6 +966,14 @@ module Xolo
966
966
  version_order&.first
967
967
  end
968
968
 
969
+ # Does a given version exist for this title?
970
+ # @param vers [String] the version in question
971
+ # @return [Boolean]
972
+ #######################
973
+ def version_exist?(vers)
974
+ version_order.include? vers
975
+ end
976
+
969
977
  # Is this a managed title?
970
978
  # @return [Boolean]
971
979
  #######################
@@ -15,12 +15,12 @@ module Xolo
15
15
  module BaseClasses
16
16
 
17
17
  # The base class for dealing with Versions/Patches in the
18
- # Xolo Server, Admin, and Client modules.
18
+ # Xolo Server & Admin modules.
19
19
  #
20
20
  # This class holds the common aspects of Xolo Versinos as used
21
- # on the Xolo server, in the Xolo Admin CLI app 'xadm', and the
22
- # client app 'xolo' - most importately it defines which data they
23
- # exchange.
21
+ # on the Xolo server and in the Xolo Admin CLI app 'xadm'
22
+ # and the 'xolo' client app (as JSON data).
23
+ # - most importately it defines which data they exchange.
24
24
  #
25
25
  ############################
26
26
  class Version < Xolo::Core::BaseClasses::ServerObject
@@ -12,7 +12,7 @@ module Xolo
12
12
 
13
13
  module Version
14
14
 
15
- VERSION = '2.2.2'.freeze
15
+ VERSION = '2.2.4'.freeze
16
16
 
17
17
  end
18
18
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xolo-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Lasell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-15 00:00:00.000000000 Z
11
+ date: 2026-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday