xolo-admin 2.2.3 → 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: 857b7c06e0c9ed5ae064b1cb7c9270341a9ac1abdfdeec8cc1ab648435db20e8
4
- data.tar.gz: 16f4edacf06637787b409f32fc86619e9e1a4910b31103d0323b6e0bc244e2c2
3
+ metadata.gz: c2b0f21f5f3a7a55117054a2fe5cd35e7e702debd3909669f969e009b603cbbe
4
+ data.tar.gz: 27f012b50a0986d7a06854f5cef89af6b549efe7a22b30faf3601418be3dc56d
5
5
  SHA512:
6
- metadata.gz: cf0e7d27e355ea94392c1ebbc96fadc4778b40476d6ab70b53ccee672c9742da95d3f8adf330275dc44370d5e8c4dcfb431a2f29503814ad1f19d93745fa4019
7
- data.tar.gz: 1e8b5ffb2ac2f473536d6624da8945382eb1e23f291ab89b9430dd4d4b5324473397d60b9d48217e5727cfa81fb7005c3e36299bb6372127dc10818d8ffef84b
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
@@ -274,6 +274,17 @@ module Xolo
274
274
  desc: <<~ENDDESC
275
275
  Show only titles that have --release-groups set to 'all'.
276
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
277
288
  }
278
289
 
279
290
  }.freeze
@@ -195,8 +195,7 @@ module Xolo
195
195
  # @return [void]
196
196
  ###############################
197
197
  def update_config
198
- debug? && puts("DEBUG: opts_to_process: #{opts_to_process}")
199
-
198
+ show_debug "DEBUG: opts_to_process: #{opts_to_process}"
200
199
  # Xolo::Admin::Configuration::KEYS.each_key do |key|
201
200
  # config.send "#{key}=", opts_to_process[key]
202
201
  # end
@@ -225,6 +224,7 @@ module Xolo
225
224
  type ||= opts_to_process.managed ? ' managed' : nil
226
225
  autopkg = opts_to_process.autopkg ? ' autopkg' : nil
227
226
  pilots = opts_to_process.pilots ? ' with unreleased pilots' : nil
227
+ vscripts = opts_to_process.version_scripts ? ' with version scripts' : nil
228
228
  to_all = opts_to_process.released_to_all ? ",\n# released to all non-excluded computers." : nil
229
229
 
230
230
  ssvc =
@@ -236,7 +236,7 @@ module Xolo
236
236
  ' updated via Self Service'
237
237
  end
238
238
 
239
- report_title = "All#{type}#{autopkg} titles in Xolo#{pilots}#{ssvc}#{to_all}"
239
+ report_title = "All#{type}#{autopkg} titles in Xolo#{pilots}#{ssvc}#{vscripts}#{to_all}"
240
240
 
241
241
  titles.select!(&:subscribed?) if opts_to_process.subscribed
242
242
  titles.reject!(&:subscribed?) if opts_to_process.managed
@@ -247,6 +247,7 @@ module Xolo
247
247
  # pending_pilots is a local method, not a title attribute!
248
248
  titles.select! { |t| pending_pilots? t } if opts_to_process.pilots
249
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
250
251
 
251
252
  header = %w[Title Created By SSvc Latest Released]
252
253
 
@@ -310,10 +311,8 @@ module Xolo
310
311
 
311
312
  response_data = new_title.add(server_cnx)
312
313
 
313
- if debug?
314
- puts "DEBUG: response_data: #{response_data}"
315
- puts
316
- end
314
+ show_debug "response_data: #{response_data}"
315
+
317
316
  if response_data[:progress_stream_url_path]
318
317
  display_progress response_data[:progress_stream_url_path]
319
318
  else
@@ -350,10 +349,7 @@ module Xolo
350
349
  title = Xolo::Admin::Title.new opts_to_process
351
350
  response_data = title.update server_cnx
352
351
 
353
- if debug?
354
- puts "DEBUG: response_data: #{response_data}"
355
- puts
356
- end
352
+ show_debug "response_data: #{response_data}"
357
353
 
358
354
  display_progress response_data[:progress_stream_url_path]
359
355
 
@@ -420,10 +416,7 @@ module Xolo
420
416
 
421
417
  response_data = Xolo::Admin::Title.delete cli_cmd.title, server_cnx
422
418
 
423
- if debug?
424
- puts "DEBUG: response_data: #{response_data}"
425
- puts
426
- end
419
+ show_debug "response_data: #{response_data}"
427
420
 
428
421
  display_progress response_data[:progress_stream_url_path]
429
422
 
@@ -448,10 +441,7 @@ module Xolo
448
441
  title = Xolo::Admin::Title.fetch cli_cmd.title, server_cnx
449
442
  response_data = title.freeze ARGV, cli_cmd_opts.users_given, server_cnx
450
443
 
451
- if debug?
452
- puts "DEBUG: response_data: #{response_data}"
453
- puts
454
- end
444
+ show_debug "response_data: #{response_data}"
455
445
 
456
446
  if json?
457
447
  puts JSON.pretty_generate(response_data)
@@ -473,10 +463,7 @@ module Xolo
473
463
  def list_frozen
474
464
  title = Xolo::Admin::Title.fetch cli_cmd.title, server_cnx
475
465
  frozen_computers = title.frozen server_cnx
476
- if debug?
477
- puts "DEBUG: response_data: #{frozen_computers}"
478
- puts
479
- end
466
+ show_debug "response_data: #{frozen_computers}"
480
467
 
481
468
  if json?
482
469
  puts JSON.pretty_generate(frozen_computers)
@@ -511,10 +498,7 @@ module Xolo
511
498
  title = Xolo::Admin::Title.fetch cli_cmd.title, server_cnx
512
499
  response_data = title.thaw ARGV, cli_cmd_opts.users_given, server_cnx
513
500
 
514
- if debug?
515
- puts "DEBUG: response_data: #{response_data}"
516
- puts
517
- end
501
+ show_debug "response_data: #{response_data}"
518
502
 
519
503
  if json?
520
504
  puts JSON.pretty_generate(response_data)
@@ -580,14 +564,13 @@ module Xolo
580
564
  new_vers = Xolo::Admin::Version.new opts_to_process
581
565
  response_data = new_vers.add(server_cnx)
582
566
 
583
- if debug?
584
- puts "DEBUG: response_data: #{response_data}"
585
- puts
586
- end
567
+ show_debug "response_data: #{response_data}"
587
568
 
588
569
  display_progress response_data[:progress_stream_url_path]
589
570
 
590
571
  # Upload the pkg, if any?
572
+ # for pkg creation, no upload if autopkg.
573
+ # but yes for edits.
591
574
  upload_pkg(new_vers) unless title_obj.autopkg_enabled?
592
575
 
593
576
  speak 'It can take up to 15 minutes for the version to be available for use. Please do not release it before then'
@@ -608,11 +591,16 @@ module Xolo
608
591
  # @return [void]
609
592
  ################################
610
593
  def upload_pkg(version)
611
- 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
612
598
 
613
- # 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
614
601
 
615
602
  speak "Uploading #{version.pkg_to_upload.basename}, #{version.pkg_to_upload.pix_humanize_size} to Xolo"
603
+
616
604
  # start the upload in a thread
617
605
  upload_thr = Thread.new { version.upload_pkg(upload_cnx) }
618
606
 
@@ -642,14 +630,12 @@ module Xolo
642
630
 
643
631
  response_data = vers.update server_cnx
644
632
 
645
- if debug?
646
- puts "DEBUG: response_data: #{response_data}"
647
- puts
648
- end
633
+ show_debug "response_data: #{response_data}"
649
634
 
650
635
  display_progress response_data[:progress_stream_url_path]
651
636
 
652
637
  # Upload the pkg, if any?
638
+ # speak 'Upload would happen here'
653
639
  upload_pkg(vers)
654
640
 
655
641
  speak "Version '#{cli_cmd.version}' of title '#{cli_cmd.title}' has been updated in Xolo."
@@ -712,10 +698,7 @@ module Xolo
712
698
 
713
699
  response_data = Xolo::Admin::Version.delete cli_cmd.title, cli_cmd.version, server_cnx
714
700
 
715
- if debug?
716
- puts "DEBUG: response_data: #{response_data}"
717
- puts
718
- end
701
+ show_debug "response_data: #{response_data}"
719
702
 
720
703
  display_progress response_data[:progress_stream_url_path]
721
704
  rescue StandardError => e
@@ -734,10 +717,7 @@ module Xolo
734
717
  title = Xolo::Admin::Title.new opts_to_process
735
718
  response_data = title.release server_cnx, version: cli_cmd.version
736
719
 
737
- if debug?
738
- puts "DEBUG: response_data: #{response_data}"
739
- puts
740
- end
720
+ show_debug "response_data: #{response_data}"
741
721
 
742
722
  display_progress response_data[:progress_stream_url_path]
743
723
  speak "Version '#{cli_cmd.version}' of Title '#{cli_cmd.title}' has been released."
@@ -886,10 +866,7 @@ module Xolo
886
866
  title = Xolo::Admin::Title.fetch cli_cmd.title, server_cnx
887
867
  response_data = title.repair server_cnx, versions: opts_to_process[:versions]
888
868
  end
889
- if debug?
890
- puts "DEBUG: response_data: #{response_data}"
891
- puts
892
- end
869
+ show_debug "response_data: #{response_data}"
893
870
 
894
871
  display_progress response_data[:progress_stream_url_path]
895
872
  rescue StandardError => e
@@ -1113,10 +1090,7 @@ module Xolo
1113
1090
  result = server_cnx.post(SERVER_SHUTDOWN_ROUTE, payload).body
1114
1091
  puts "result[:result] = #{result[:result]}"
1115
1092
 
1116
- if debug?
1117
- puts "DEBUG: response_data: #{result}"
1118
- puts
1119
- end
1093
+ show_debug "response_data: #{result}"
1120
1094
 
1121
1095
  display_progress result[:progress_stream_url_path]
1122
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.
@@ -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.3'.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.3
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-17 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