Class: Xolo::Server::Version

Inherits:
Core::BaseClasses::Version
  • Object
show all
Includes:
Comparable, Helpers::JamfPro, Helpers::Log, Helpers::Notification, Helpers::TitleEditor, Mixins::Changelog, Mixins::VersionJamfAccess, Mixins::VersionTedAccess
Defined in:
lib/xolo/server/version.rb

Overview

Xolo Version/Patch as used on the Xolo Server

The code in this file mostly deals with the data on the Xolo server itself, and general methods for manipulating the version.

Code for interacting with the Title Editor and Jamf Pro are in the helpers and mixins.

NOTE be sure to only instantiate these using the server's 'instantiate_version' method, or else they might not have all the correct innards

Constant Summary collapse

VERSIONS_DIRNAME =

On the server, xolo versions are represented by JSON files in the 'versions' directory of the title directory

So a title 'foobar' would have a directory (Xolo::Server::DATA_DIR)/titles/foobar/

In there will be a 'versions' dir containing json files for each version of the title.

'versions'
JAMF_PKG_NOTES_VERS_PH =
'XOLO-VERSION-HERE'
JAMF_PKG_NOTES_TITLE_PH =
'XOLO-TITLE-HERE'
JAMF_PKG_NOTES_PREFIX =

The 'Notes' of a jamf pkg are the Xolo Title Description, with this prepended

"This package is maintained by 'xolo', to install version '\#{JAMF_PKG_NOTES_VERS_PH}' of title '\#{JAMF_PKG_NOTES_TITLE_PH}'. The description in Xolo is:\n\n\n"
MAX_PKG_DELETION_THREADS =
10
STUB_PATCH_VERSION =

STUB PATCH

We create a fake 'stub' patch with all ted titles so that we can activate the title before any real version is added and also accept any EA/version_script, either manually or automatically

This version should never be available to any mac, and needs no patch policies or packages.

It should also never be deleted until the title itself is deleted.

'0.0.0x0'
STUB_PATCH_CAPABILITY_CRITERION_NAME =

machines that can install this version

'Operating System Version'
STUB_PATCH_CAPABILITY_CRITERION_OPERATOR =
'less than or equal'
STUB_PATCH_CAPABILITY_CRITERION_VALUE =
'10.0'
STUB_PATCH_COMPONENT_CRITERION_NAME =

machines that have this version installed STUB_PATCH_COMPONENT_NAME = 'Xolo Stub'

'Application Title'
STUB_PATCH_COMPONENT_CRITERION_OPERATOR =
'is'
STUB_PATCH_COMPONENT_CRITERION_VALUE =
'XoloStub-DoesNotExist.app'

Constants included from Mixins::VersionJamfAccess

Mixins::VersionJamfAccess::JAMF_POLICY_NAME_AUTO_INSTALL_SFX, Mixins::VersionJamfAccess::JAMF_POLICY_NAME_AUTO_REINSTALL_SFX, Mixins::VersionJamfAccess::JAMF_POLICY_NAME_MANUAL_INSTALL_SFX, Mixins::VersionJamfAccess::JAMF_SMART_GROUP_NAME_INSTALLED_SFX, Mixins::VersionJamfAccess::PATCH_POL_GRACE_PERIOD_MINUTES, Mixins::VersionJamfAccess::PATCH_POL_GRACE_PERIOD_MSG, Mixins::VersionJamfAccess::PATCH_POL_GRACE_PERIOD_SUBJ, Mixins::VersionJamfAccess::PATCH_POL_SSVC_DEADLINE_DAYS, Mixins::VersionJamfAccess::PATCH_POL_SSVC_INSTALL_BTN_TXT, Mixins::VersionJamfAccess::PATCH_POL_SSVC_NOTIFICATION_TYPE, Mixins::VersionJamfAccess::PATCH_POL_SSVC_REMINDER_FREQ_HRS

Constants included from Mixins::Changelog

Mixins::Changelog::TITLE_CHANGELOG_FILENAME

Constants included from Helpers::Notification

Helpers::Notification::ALERT_TOOL_EMAIL_PREFIX, Helpers::Notification::DFT_EMAIL_FROM

Constants included from Helpers::JamfPro

Helpers::JamfPro::PATCH_REPORT_JPAPI_PAGE_SIZE, Helpers::JamfPro::PATCH_REPORT_UNKNOWN_VERSION

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixins::VersionTedAccess

#create_patch_in_ted, #delete_patch_from_ted, #enable_ted_patch, #get_patch_component_criteria_params, included, #repair_ted_patch, #set_patch_capabilites, #set_patch_killapps, #set_ted_patch_component_criteria, #ted_patch_url, #update_patch_in_ted

Methods included from Mixins::VersionJamfAccess

#activate_managed_patch_version_in_jamf, #activate_patch_version_in_jamf, #activate_subscribed_patch_version_in_jamf, #assign_pkg_to_patch_in_jamf, #configure_jamf_auto_install_policy, #configure_jamf_auto_reinstall_policy, #configure_jamf_installed_group, #configure_jamf_manual_install_policy, #configure_jamf_patch_policy, #configure_patch_pol_deployment, #create_in_jamf, #create_jamf_auto_install_policy, #create_jamf_auto_reinstall_policy, #create_jamf_installed_group, #create_jamf_manual_install_policy, #create_jamf_package, #create_jamf_patch_policy, #delete_jamf_package, #delete_version_from_jamf, #deploy_via_mdm, #disable_policies_for_deprecation_or_skipping, #expand_groups_for_deploy, extended, included, #jamf_auto_install_policy, #jamf_auto_install_policy_exist?, #jamf_auto_install_policy_url, #jamf_auto_reinstall_policy, #jamf_auto_reinstall_policy_exist?, #jamf_auto_reinstall_policy_url, #jamf_gui_url, #jamf_installed_group, #jamf_installed_group_criteria, #jamf_installed_group_exist?, #jamf_installed_group_url, #jamf_manual_install_policy, #jamf_manual_install_policy_exist?, #jamf_manual_install_policy_url, #jamf_package, #jamf_package_exist?, #jamf_package_notes, #jamf_package_url, #jamf_patch_policy, #jamf_patch_policy_exist?, #jamf_patch_policy_url, #jamf_patch_version, #patch_report, #remove_exclusions_from_deploy, #remove_invalid_computers_for_deploy, #repair_jamf_auto_install_policy, #repair_jamf_auto_reinstall_policy, #repair_jamf_installed_group, #repair_jamf_manual_install_policy, #repair_jamf_package, #repair_jamf_patch_policy, #repair_jamf_version_objects, #reset_policies_to_pilot, #set_patch_policy_ssvc_icon, #set_policy_exclusions, #set_policy_pilot_groups, #set_policy_release_groups, #set_policy_to_all_targets, #update_excluded_groups, #update_jamf_package_notes, #update_jamf_patch_policy_patch_unknown, #update_jamf_pkg_min_os, #update_jamf_pkg_reboot, #update_patch_policy_deployment, #update_pilot_groups, #update_release_groups, #update_version_in_jamf, #use_ssvc_updates?

Methods included from Mixins::Changelog

#backup_changelog, backup_file_dir, #changelog, #changelog_backup_file, #changelog_file, #changelog_lock, changelog_locks, #delete_changelog, #hostname_from_ip, included, #log_change, #log_update_changes, #note_changes_for_update_and_log

Methods included from Helpers::Notification

#email_from, included, #send_alert, #send_email, #send_email_alert, #server_fqdn, #server_name

Methods included from Helpers::Log

included, #log_debug, #log_error, #log_fatal, #log_info, #log_unknown, #log_warn, #logger, #session_svr_obj_id

Methods included from Helpers::TitleEditor

included, set_app_component, set_ea_component, set_patch_component_criteria

Methods included from Helpers::JamfPro

extended, included, #jamf_gui_url, #jamf_obj_name_pfx_base, #jamf_xolo_category_id, #valid_forced_exclusion_group_name

Constructor Details

#initialize(data_hash) ⇒ Version

NOTE: be sure to only instantiate these using the servers 'instantiate_version' method, or else they might not have all the correct innards



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/xolo/server/version.rb', line 424

def initialize(data_hash)
  super

  # These attrs aren't defined in the ATTRIBUTES
  # and/or are not stored in the on-disk json file

  @ted_id_number ||= data_hash[:ted_id_number]
  @jamf_pkg_id ||= data_hash[:jamf_pkg_id]

  # and these can be generated now
  @jamf_obj_name_pfx = "#{jamf_obj_name_pfx_base}#{title}-#{version}"

  @jamf_pkg_name ||= @jamf_obj_name_pfx

  @jamf_installed_group_name = "#{jamf_obj_name_pfx}-#{JAMF_SMART_GROUP_NAME_INSTALLED_SFX}"

  @jamf_auto_install_policy_name = "#{jamf_obj_name_pfx}-#{JAMF_POLICY_NAME_AUTO_INSTALL_SFX}"
  @jamf_manual_install_policy_name = "#{jamf_obj_name_pfx}-#{JAMF_POLICY_NAME_MANUAL_INSTALL_SFX}"
  @jamf_auto_reinstall_policy_name = "#{jamf_obj_name_pfx}-#{JAMF_POLICY_NAME_AUTO_REINSTALL_SFX}"

  @jamf_patch_policy_name = @jamf_obj_name_pfx

  # we set @jamf_pkg_file when a pkg is uploaded
  # since we don't know until then if its a .pkg or .zip
  # It will be stored in the local data and reloaded as needed
end

Instance Attribute Details

#changes_for_updateHash (readonly)

Also when applying updates, this will hold the changes being made: the differences between tne current attributs and the new_data_for_update We'll figure this out at the start of the update and can use it later to

  1. avoid doing things we don't need to
  2. log the changes in the change log at the very end

This is a Hash with keys of the attribute names that have changed the values are Hashes with keys of :old and :new e.g. { pilot_groups: { old: ['foo'], new: ['bar'] } }

Returns:

  • (Hash)


408
409
410
# File 'lib/xolo/server/version.rb', line 408

def changes_for_update
  @changes_for_update
end

#current_actionSymbol

Returns The current action being taken on this title one of :creating, :updating, :deleting.

Returns:

  • (Symbol)

    The current action being taken on this title one of :creating, :updating, :deleting



412
413
414
# File 'lib/xolo/server/version.rb', line 412

def current_action
  @current_action
end

#jamf_auto_install_policy_nameObject (readonly)

Jamf auto-install policies are named this



373
374
375
# File 'lib/xolo/server/version.rb', line 373

def jamf_auto_install_policy_name
  @jamf_auto_install_policy_name
end

#jamf_auto_reinstall_policy_nameObject (readonly)

Jamf auto re-install policies are named this



379
380
381
# File 'lib/xolo/server/version.rb', line 379

def jamf_auto_reinstall_policy_name
  @jamf_auto_reinstall_policy_name
end

#jamf_installed_group_nameString (readonly)

For each version there will be a smart group containing all macs that have that version of the title installed. The smart group will be named 'xolo--<version>-installed'</p> <p>It will be used as the target for the auto-reinstall</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>String</tt>)</span> — <div class='inline'><p>the name of the smart group</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 370 371 372</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 370</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_jamf_installed_group_name identifier id'>jamf_installed_group_name</span> <span class='rubyid_@jamf_installed_group_name ivar id'>@jamf_installed_group_name</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <span id=""></span> <div class="method_details "> <h3 class="signature " id="jamf_manual_install_policy_name-instance_method"> #<strong>jamf_manual_install_policy_name</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span> <span class="aliases">Also known as: <span class="names"><span id='jamf_manual_install_trigger-instance_method'>jamf_manual_install_trigger</span></span> </span> </h3><script> document.getElementById("jamf_manual_install_policy_name-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:jamf_manual_install_policy_name">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Jamf manual install policies are named this</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 376 377 378</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 376</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_jamf_manual_install_policy_name identifier id'>jamf_manual_install_policy_name</span> <span class='rubyid_@jamf_manual_install_policy_name ivar id'>@jamf_manual_install_policy_name</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <span id=""></span> <div class="method_details "> <h3 class="signature " id="jamf_obj_name_pfx-instance_method"> #<strong>jamf_obj_name_pfx</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span> </h3><script> document.getElementById("jamf_obj_name_pfx-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:jamf_obj_name_pfx">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Jamf object names start with this</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 361 362 363</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 361</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_jamf_obj_name_pfx identifier id'>jamf_obj_name_pfx</span> <span class='rubyid_@jamf_obj_name_pfx ivar id'>@jamf_obj_name_pfx</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <span id=""></span> <div class="method_details "> <h3 class="signature " id="jamf_patch_policy_name-instance_method"> #<strong>jamf_patch_policy_name</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span> </h3><script> document.getElementById("jamf_patch_policy_name-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:jamf_patch_policy_name">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Jamf Patch Policy is named this</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 385 386 387</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 385</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_jamf_patch_policy_name identifier id'>jamf_patch_policy_name</span> <span class='rubyid_@jamf_patch_policy_name ivar id'>@jamf_patch_policy_name</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <span id=""></span> <div class="method_details "> <h3 class="signature " id="jamf_pkg_id-instance_method"> #<strong>jamf_pkg_id</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span> </h3><script> document.getElementById("jamf_pkg_id-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:jamf_pkg_id">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The Jamf Package object has this jamf id</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 388 389 390</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 388</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_jamf_pkg_id identifier id'>jamf_pkg_id</span> <span class='rubyid_@jamf_pkg_id ivar id'>@jamf_pkg_id</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <span id=""></span> <div class="method_details "> <h3 class="signature " id="new_data_for_update-instance_method"> #<strong>new_data_for_update</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span> </h3><script> document.getElementById("new_data_for_update-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:new_data_for_update">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>when applying updates, the new data is stored here so it can be accessed by update-methods and compared to the current instanace values both for updating the title, and the versions</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 394 395 396</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 394</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_new_data_for_update identifier id'>new_data_for_update</span> <span class='rubyid_@new_data_for_update ivar id'>@new_data_for_update</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <span id="pkg_is_from_autopkg=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="pkg_is_from_autopkg-instance_method"> #<strong>pkg_is_from_autopkg</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("pkg_is_from_autopkg-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:pkg_is_from_autopkg">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns is the pkg being processed now from an autopkg recipe?.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> — <div class='inline'><p>is the pkg being processed now from an autopkg recipe?</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 415 416 417</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 415</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_pkg_is_from_autopkg identifier id'>pkg_is_from_autopkg</span> <span class='rubyid_@pkg_is_from_autopkg ivar id'>@pkg_is_from_autopkg</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <span id="server_app_instance=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="server_app_instance-instance_method"> #<strong>server_app_instance</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("server_app_instance-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:server_app_instance">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The instance of Xolo::Server::App that instantiated this version object. This is how we access things that are available in routes and helpers, like the single Jamf and TEd connections for this App instance.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 348 349 350</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 348</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span> <span class='rubyid_@server_app_instance ivar id'>@server_app_instance</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <span id="ted_id_number=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="ted_id_number-instance_method"> #<strong>ted_id_number</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("ted_id_number-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:ted_id_number">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The Windoo::Patch#patchId</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 358 359 360</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 358</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_ted_id_number identifier id'>ted_id_number</span> <span class='rubyid_@ted_id_number ivar id'>@ted_id_number</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <span id="title_object=-instance_method"></span> <div class="method_details "> <h3 class="signature " id="title_object-instance_method"> #<strong>title_object</strong>(refresh: false) ⇒ <tt><span class='object_link'><a href="/gems/xolo-server/2.3.0/Xolo/Server/Title" title="Xolo::Server::Title (class)">Xolo::Server::Title</a></span></tt> </h3><script> document.getElementById("title_object-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:title_object">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>This might have been set already if we were instantiated via our title</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt><span class='object_link'><a href="/gems/xolo-server/2.3.0/Xolo/Server/Title" title="Xolo::Server::Title (class)">Xolo::Server::Title</a></span></tt>)</span> — <div class='inline'><p>the title for this version</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 615 616 617 618</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 615</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='lparen token'>(</span><span class='label val'>refresh:</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span> <span class='rubyid_@title_object ivar id'>@title_object</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_refresh identifier id'>refresh</span> <span class='rubyid_@title_object ivar id'>@title_object</span> <span class='opasgn op'>||=</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_instantiate_title identifier id'>instantiate_title</span> <span class='rubyid_title identifier id'>title</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> </div> <div id="class_method_details" class="method_details_list"> <h2>Class Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="add_version_via_subscription-class_method"> .<strong>add_version_via_subscription</strong>(title_object:, new_version:) ⇒ <tt>void</tt> </h3><script> document.getElementById("add_version_via_subscription-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Eadd_version_via_subscription">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>add a new version in response to a patch title update webhook event. This doesn't upload a pkg - it just creates the version in Xolo, and then someone can upload a pkg to it via xadm or autopkg will do it if configured.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>title_object</span> <span class='type'>(<tt><span class='object_link'><a href="/gems/xolo-server/2.3.0/Xolo/Server/Title" title="Xolo::Server::Title (class)">Xolo::Server::Title</a></span></tt>)</span> — <div class='inline'><p>the title object for the subscribed title</p></div> </li> <li> <span class='name'>new_version</span> <span class='type'>(<tt>String</tt>)</span> — <div class='inline'><p>the new version to add</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 234</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_add_version_via_subscription identifier id'>add_version_via_subscription</span><span class='lparen token'>(</span><span class='label val'>title_object:</span><span class='comma token'>,</span> <span class='label val'>new_version:</span><span class='rparen token'>)</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_log_info identifier id'>log_info</span> <span class='dstring node'>"Adding new version '#{new_version}' for subscribed title '#{title_object.title}'"</span> <span class='rubyid_vobj_data identifier id'>vobj_data</span> <span class='assign token'>=</span> <span class='rubyid_new_subscribed_version_data identifier id'>new_subscribed_version_data</span><span class='lparen token'>(</span><span class='label val'>title_object:</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='comma token'>,</span> <span class='label val'>new_version:</span> <span class='rubyid_new_version identifier id'>new_version</span><span class='rparen token'>)</span> <span class='rubyid_unless unless kw'>unless</span> <span class='rubyid_vobj_data identifier id'>vobj_data</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='dstring node'>"Could not get patch version data from JPAPI for version '#{new_version}' of subscribed title '#{title_object.title}'. Cannot create new version in Xolo without this data. Aborting."</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_log_error identifier id'>log_error</span> <span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>alert:</span> <span class='rubyid_true true kw'>true</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_end end kw'>end</span> <span class='comment val'># instantiate the version object</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Instantiating version via subscription '#{new_version}' of title '#{title_object.title}' (#{title_object.class}) with data: #{vobj_data}"</span> <span class='rubyid_vobj identifier id'>vobj</span> <span class='assign token'>=</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_instantiate_version identifier id'>instantiate_version</span><span class='lparen token'>(</span> <span class='label val'>title:</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='comma token'>,</span> <span class='label val'>version:</span> <span class='rubyid_new_version identifier id'>new_version</span><span class='comma token'>,</span> <span class='pow op'>**</span><span class='rubyid_vobj_data identifier id'>vobj_data</span> <span class='rparen token'>)</span> <span class='comment val'># create it in xolo</span> <span class='rubyid_vobj identifier id'>vobj</span><span class='dot token'>.</span><span class='rubyid_create identifier id'>create</span> <span class='comment val'># tell someone</span> <span class='rubyid_send_alerts_about_new_subscribed_version identifier id'>send_alerts_about_new_subscribed_version</span><span class='lparen token'>(</span><span class='label val'>title_object:</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='comma token'>,</span> <span class='label val'>vobj:</span> <span class='rubyid_vobj identifier id'>vobj</span><span class='rparen token'>)</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="all_versions-class_method"> .<strong>all_versions</strong>(title) ⇒ <tt>Array<String></tt> </h3><script> document.getElementById("all_versions-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Eall_versions">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns A list of all known versions for a title, just the basenames of all the version files with the extension removed.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Array<String></tt>)</span> — <div class='inline'><p>A list of all known versions for a title, just the basenames of all the version files with the extension removed</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 117 118 119</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 117</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_all_versions identifier id'>all_versions</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='rparen token'>)</span> <span class='rubyid_version_dirs identifier id'>version_dirs</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='rubyid_c identifier id'>c</span><span class='bitor op'>|</span> <span class='rubyid_c identifier id'>c</span><span class='dot token'>.</span><span class='rubyid_basename identifier id'>basename</span><span class='dot token'>.</span><span class='rubyid_to_s identifier id'>to_s</span> <span class='rbrace token'>}</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="data_dir-class_method"> .<strong>data_dir</strong>(title, version) ⇒ <tt>Pathname</tt> </h3><script> document.getElementById("data_dir-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Edata_dir">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The the local directory containing various files specific to the given version of a title</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Pathname</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 130 131 132</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 130</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_data_dir identifier id'>data_dir</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='rubyid_version_dir identifier id'>version_dir</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='rubyid_version identifier id'>version</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="data_file-class_method"> .<strong>data_file</strong>(title, version) ⇒ <tt>Pathname</tt> </h3><script> document.getElementById("data_file-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Edata_file">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The the local JSON file containing the current values for the given version of a title</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Pathname</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 143 144 145</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 143</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_data_file identifier id'>data_file</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='rubyid_data_dir identifier id'>data_dir</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='dstring node'>"#{version}.json"</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="in_ted?-class_method"> .<strong>in_ted?</strong>(patch_id, cnx:) ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("in_ted?-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Ein_ted%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns Does the given patch exist in the Title Editor?.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>patch_id</span> <span class='type'>(<tt>String</tt>)</span> — <div class='inline'><p>the id number of the patch we are looking for</p></div> </li> </ul> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> — <div class='inline'><p>Does the given patch exist in the Title Editor?</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 182 183 184</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 182</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_in_ted? fid id'>in_ted?</span><span class='lparen token'>(</span><span class='rubyid_patch_id identifier id'>patch_id</span><span class='comma token'>,</span> <span class='label val'>cnx:</span><span class='rparen token'>)</span> <span class='rubyid_Windoo constant id'>Windoo</span><span class='colon2 op'>::</span><span class='rubyid_Patch constant id'>Patch</span><span class='dot token'>.</span><span class='rubyid_all_ids identifier id'>all_ids</span><span class='lparen token'>(</span><span class='label val'>cnx:</span> <span class='rubyid_cnx identifier id'>cnx</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_include? fid id'>include?</span> <span class='rubyid_patch_id identifier id'>patch_id</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="load-class_method"> .<strong>load</strong>(title, version) ⇒ <tt><span class='object_link'><a href="/gems/xolo-server/2.3.0/Xolo/Server/Title" title="Xolo::Server::Title (class)">Xolo::Server::Title</a></span></tt> </h3><script> document.getElementById("load-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Eload">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Instantiate from the local JSON file containing the current values for the given version of a title</p> <p>NOTE: All instantiation should happen using the #instantiate_version method in the server app instance. Please don't call this method directly</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt><span class='object_link'><a href="/gems/xolo-server/2.3.0/Xolo/Server/Title" title="Xolo::Server::Title (class)">Xolo::Server::Title</a></span></tt>)</span> — <div class='inline'><p>load an existing title from the on-disk JSON file</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 173 174 175 176</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 173</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_load identifier id'>load</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='dot token'>.</span><span class='rubyid_logger identifier id'>logger</span><span class='dot token'>.</span><span class='rubyid_debug identifier id'>debug</span> <span class='dstring node'>"Loading version '#{version}' of title '#{title}' from file"</span> <span class='rubyid_new identifier id'>new</span> <span class='rubyid_parse_json identifier id'>parse_json</span><span class='lparen token'>(</span><span class='rubyid_data_file identifier id'>data_file</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_read identifier id'>read</span><span class='rparen token'>)</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="locked?-class_method"> .<strong>locked?</strong>(title, version) ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("locked?-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Elocked%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Is a version locked for updates?</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 188 189 190 191</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 188</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_locked? fid id'>locked?</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='rubyid_curr_lock identifier id'>curr_lock</span> <span class='assign token'>=</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='dot token'>.</span><span class='rubyid_object_locks identifier id'>object_locks</span><span class='dot token'>.</span><span class='rubyid_dig identifier id'>dig</span> <span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='symbol val'>:versions</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span> <span class='rubyid_curr_lock identifier id'>curr_lock</span> <span class='andop op'>&&</span> <span class='rubyid_curr_lock identifier id'>curr_lock</span> <span class='gt op'>></span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="manifest_file-class_method"> .<strong>manifest_file</strong>(title, version) ⇒ <tt>Pathname</tt> </h3><script> document.getElementById("manifest_file-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Emanifest_file">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The the local xml plist file containing the .pkg manifest for the given version of a title</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Pathname</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 156 157 158</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 156</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_manifest_file identifier id'>manifest_file</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='rubyid_data_dir identifier id'>data_dir</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='dstring node'>"#{version}.manifest.plist"</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="new_subscribed_version_data-class_method"> .<strong>new_subscribed_version_data</strong>(title_object:, new_version:) ⇒ <tt>Hash</tt> </h3><script> document.getElementById("new_subscribed_version_data-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Enew_subscribed_version_data">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Gather the data needed to create a new xolo version from a subscription</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Hash</tt>)</span> — <div class='inline'><p>the data needed to create the version object</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 264</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_new_subscribed_version_data identifier id'>new_subscribed_version_data</span><span class='lparen token'>(</span><span class='label val'>title_object:</span><span class='comma token'>,</span> <span class='label val'>new_version:</span><span class='rparen token'>)</span> <span class='rubyid_patch_version_data identifier id'>patch_version_data</span> <span class='assign token'>=</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_patch_versions identifier id'>patch_versions</span><span class='lparen token'>(</span><span class='label val'>version:</span> <span class='rubyid_new_version identifier id'>new_version</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_first identifier id'>first</span> <span class='comment val'># return nil if not found - will send error alert</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_patch_version_data identifier id'>patch_version_data</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Got patch version data from JPAPI for version '#{new_version}': #{patch_version_data}"</span> <span class='comment val'># put the data into a hash for creating a new version object</span> <span class='rubyid_vobj_data identifier id'>vobj_data</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span> <span class='label val'>publish_date:</span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_parse identifier id'>parse</span><span class='lparen token'>(</span><span class='rubyid_patch_version_data identifier id'>patch_version_data</span><span class='lbrack token'>[</span><span class='symbol val'>:releaseDate</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='label val'>standalone:</span> <span class='rubyid_patch_version_data identifier id'>patch_version_data</span><span class='lbrack token'>[</span><span class='symbol val'>:standalone</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='label val'>min_os:</span> <span class='rubyid_patch_version_data identifier id'>patch_version_data</span><span class='lbrack token'>[</span><span class='symbol val'>:minimumOperatingSystem</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='label val'>reboot:</span> <span class='rubyid_patch_version_data identifier id'>patch_version_data</span><span class='lbrack token'>[</span><span class='symbol val'>:rebootRequired</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='label val'>killapps:</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span> <span class='rbrace token'>}</span> <span class='comment val'># Killapps for subscribed titles? The API only shows app names without the .app, e.g.</span> <span class='comment val'># "killApps": [</span> <span class='comment val'># {</span> <span class='comment val'># "appName": "ChrislTestHelper"</span> <span class='comment val'># },</span> <span class='comment val'># {</span> <span class='comment val'># "appName": "Chrisl Test"</span> <span class='comment val'># }</span> <span class='comment val'># ]</span> <span class='comment val'># Since we don't manage them, we'll just record them in the data like this...</span> <span class='rubyid_unless unless kw'>unless</span> <span class='rubyid_patch_version_data identifier id'>patch_version_data</span><span class='lbrack token'>[</span><span class='symbol val'>:killApps</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_pix_empty? fid id'>pix_empty?</span> <span class='rubyid_patch_version_data identifier id'>patch_version_data</span><span class='lbrack token'>[</span><span class='symbol val'>:killApps</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_ka identifier id'>ka</span><span class='bitor op'>|</span> <span class='rubyid_vobj_data identifier id'>vobj_data</span><span class='lbrack token'>[</span><span class='symbol val'>:killapps</span><span class='rbrack token'>]</span> <span class='lshft op'><<</span> <span class='dstring node'>"#{ka[:appName]}.app;unknown.from.subscription"</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_vobj_data identifier id'>vobj_data</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="pkg_deletion_pool-class_method"> .<strong>pkg_deletion_pool</strong> ⇒ <tt>Queue</tt> </h3><script> document.getElementById("pkg_deletion_pool-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Epkg_deletion_pool">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The package-deletion thread pool</p> <p>the auto_terminate is false to prevents the threads from being daemonized, and running after the main thread exits. This is important because launchd jobs should never do that.</p> <p>See <a href="https://ruby-concurrency.github.io/concurrent-ruby/master/file.thread_pools.html">https://ruby-concurrency.github.io/concurrent-ruby/master/file.thread_pools.html</a></p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Queue</tt>)</span> — <div class='inline'><p>The package-deletion thread pool</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 202 203 204 205 206 207 208 209 210 211 212 213</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 202</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_pkg_deletion_pool identifier id'>pkg_deletion_pool</span> <span class='rubyid_@pkg_deletion_pool ivar id'>@pkg_deletion_pool</span> <span class='opasgn op'>||=</span> <span class='rubyid_Concurrent constant id'>Concurrent</span><span class='colon2 op'>::</span><span class='rubyid_ThreadPoolExecutor constant id'>ThreadPoolExecutor</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span> <span class='label val'>name:</span> <span class='string val'>'package-deletion'</span><span class='comma token'>,</span> <span class='label val'>min_threads:</span> <span class='integer val'>1</span><span class='comma token'>,</span> <span class='comment val'># start with 1 thread</span> <span class='label val'>max_threads:</span> <span class='rubyid_MAX_PKG_DELETION_THREADS constant id'>MAX_PKG_DELETION_THREADS</span><span class='comma token'>,</span> <span class='comment val'># create at most 10 threads</span> <span class='label val'>max_queue:</span> <span class='integer val'>0</span><span class='comma token'>,</span> <span class='comment val'># no limit</span> <span class='label val'>auto_terminate:</span> <span class='rubyid_false false kw'>false</span><span class='comma token'>,</span> <span class='comment val'># see method comments above</span> <span class='label val'>idletime:</span> <span class='integer val'>60</span> <span class='comment val'># seconds thread can remain idle before it is reclaimed, default is 60</span> <span class='comment val'># fallback_policy: :abort # the default is :abort, which will raise a</span> <span class='comment val'># Concurrent::RejectedExecutionError exception and discard the task</span> <span class='rparen token'>)</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="pkg_deletion_pool_info-class_method"> .<strong>pkg_deletion_pool_info</strong> ⇒ <tt>Hash</tt> </h3><script> document.getElementById("pkg_deletion_pool_info-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Epkg_deletion_pool_info">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>info about the current pkg deletion pool state, for the /state route</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Hash</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 219 220 221 222 223 224</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 219</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_pkg_deletion_pool_info identifier id'>pkg_deletion_pool_info</span> <span class='lbrace token'>{</span> <span class='label val'>threads:</span> <span class='rubyid_pkg_deletion_pool identifier id'>pkg_deletion_pool</span><span class='dot token'>.</span><span class='rubyid_length identifier id'>length</span><span class='comma token'>,</span> <span class='label val'>queued_tasks:</span> <span class='rubyid_pkg_deletion_pool identifier id'>pkg_deletion_pool</span><span class='dot token'>.</span><span class='rubyid_queue_length identifier id'>queue_length</span> <span class='rbrace token'>}</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="send_alerts_about_new_subscribed_version-class_method"> .<strong>send_alerts_about_new_subscribed_version</strong>(title_object:, vobj:) ⇒ <tt>Object</tt> </h3><script> document.getElementById("send_alerts_about_new_subscribed_version-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Esend_alerts_about_new_subscribed_version">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Handle alerts for newly-created subscribed version</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 301</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_send_alerts_about_new_subscribed_version identifier id'>send_alerts_about_new_subscribed_version</span><span class='lparen token'>(</span><span class='label val'>title_object:</span><span class='comma token'>,</span> <span class='label val'>vobj:</span><span class='rparen token'>)</span> <span class='rubyid_title identifier id'>title</span> <span class='assign token'>=</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_title identifier id'>title</span> <span class='rubyid_new_version identifier id'>new_version</span> <span class='assign token'>=</span> <span class='rubyid_vobj identifier id'>vobj</span><span class='dot token'>.</span><span class='rubyid_version identifier id'>version</span> <span class='comment val'># if here, and auto_release_delay is zero, release it immediately</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_autopkg_enabled? fid id'>autopkg_enabled?</span> <span class='rubyid_auto_release_delay identifier id'>auto_release_delay</span> <span class='assign token'>=</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_auto_release_delay identifier id'>auto_release_delay</span><span class='dot token'>.</span><span class='rubyid_to_i identifier id'>to_i</span> <span class='comment val'># is auto_release_delay an integer?</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_auto_release_delay identifier id'>auto_release_delay</span><span class='bitand op'>&</span><span class='dot token'>.</span><span class='rubyid_pix_integer? fid id'>pix_integer?</span> <span class='andop op'>&&</span> <span class='notop op'>!</span><span class='rubyid_auto_release_delay identifier id'>auto_release_delay</span><span class='dot token'>.</span><span class='rubyid_negative? fid id'>negative?</span> <span class='rubyid_how_soon identifier id'>how_soon</span> <span class='assign token'>=</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_auto_release_delay identifier id'>auto_release_delay</span><span class='dot token'>.</span><span class='rubyid_zero? fid id'>zero?</span> <span class='string val'>'tonight'</span> <span class='rubyid_elsif elsif kw'>elsif</span> <span class='rubyid_auto_release_delay identifier id'>auto_release_delay</span> <span class='eq op'>==</span> <span class='integer val'>1</span> <span class='string val'>'tomorrow night'</span> <span class='rubyid_else else kw'>else</span> <span class='dstring node'>"in #{auto_release_delayy} days"</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='dstring node'>"New pilot for subscribed title '#{title}', version '#{new_version}' has been created in Xolo via subscription.\nIt will be released during nightly maintenance #{how_soon}"</span> <span class='comment val'># nil, empty, 'none', or negative = no auto release</span> <span class='rubyid_else else kw'>else</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='dstring node'>"ACTION REQUIRED: New pilot for subscribed title '#{title}', version '#{new_version}' has been created in Xolo via subscription.\nRequires manual release."</span> <span class='rubyid_end end kw'>end</span> <span class='comment val'># if not autopkg enabled, we need to tell someone to upload a pkg for this new version</span> <span class='rubyid_else else kw'>else</span> <span class='comment val'># update general alert msg</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='dstring node'>"ACTION REQUIRED: New pilot for subscribed title '#{title}', version '#{new_version}' has been created in Xolo via subscription.\nPlease upload a .pkg for it ASAP using this command:\n xadm edit-version #{title} #{new_version} --pkg-to-upload /path/to/installer.pkg"</span> <span class='comment val'># email to title contact</span> <span class='rubyid_vobj identifier id'>vobj</span><span class='dot token'>.</span><span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_send_email identifier id'>send_email</span> <span class='label val'>to:</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_contact_email identifier id'>contact_email</span><span class='comma token'>,</span> <span class='label val'>subject:</span> <span class='string val'>'Need manual upload of xolo pkg'</span><span class='comma token'>,</span> <span class='label val'>msg:</span> <span class='rubyid_msg identifier id'>msg</span> <span class='rubyid_end end kw'>end</span> <span class='comment val'># if title_object.autopkg_enabled?</span> <span class='comment val'># send alert</span> <span class='rubyid_vobj identifier id'>vobj</span><span class='dot token'>.</span><span class='rubyid_log_info identifier id'>log_info</span> <span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>alert:</span> <span class='rubyid_true true kw'>true</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="version_dir-class_method"> .<strong>version_dir</strong>(title) ⇒ <tt>Pathname</tt> </h3><script> document.getElementById("version_dir-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Eversion_dir">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns The directory containing subdirectories for each version of a title. They contain JSON and other files for the versions.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Pathname</tt>)</span> — <div class='inline'><p>The directory containing subdirectories for each version of a title. They contain JSON and other files for the versions.</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 101 102 103</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 101</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_version_dir identifier id'>version_dir</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='rparen token'>)</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='colon2 op'>::</span><span class='rubyid_Title constant id'>Title</span><span class='dot token'>.</span><span class='rubyid_title_dir identifier id'>title_dir</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='rparen token'>)</span> <span class='plus op'>+</span> <span class='rubyid_VERSIONS_DIRNAME constant id'>VERSIONS_DIRNAME</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="version_dirs-class_method"> .<strong>version_dirs</strong>(title) ⇒ <tt>Array<Pathname></tt> </h3><script> document.getElementById("version_dirs-class_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion%2Eversion_dirs">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns All version directories for a title.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Array<Pathname></tt>)</span> — <div class='inline'><p>All version directories for a title</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 108 109 110 111</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 108</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_version_dirs identifier id'>version_dirs</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='rparen token'>)</span> <span class='rubyid_vdir identifier id'>vdir</span> <span class='assign token'>=</span> <span class='rubyid_version_dir identifier id'>version_dir</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='rparen token'>)</span> <span class='rubyid_vdir identifier id'>vdir</span><span class='dot token'>.</span><span class='rubyid_directory? fid id'>directory?</span> <span class='integer val'>? </span><span class='rubyid_vdir identifier id'>vdir</span><span class='dot token'>.</span><span class='rubyid_children identifier id'>children</span> <span class='colon op'>:</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> </div> <div id="instance_method_details" class="method_details_list"> <h2>Instance Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="<=>-instance_method"> #<strong><=></strong>(other) ⇒ <tt>Object</tt> </h3><script> document.getElementById("<=>-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:<=>">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>version comparison</p> </div> </div> <div class="tags"> <p class="tag_title">Raises:</p> <ul class="raise"> <li> <span class='type'>(<tt>Xolo::InvalidDataError</tt>)</span> </li> </ul> <p class="tag_title">See Also:</p> <ul class="see"> <li>Comparable</li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 458 459 460 461 462 463</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 458</span> <span class='rubyid_def def kw'>def</span> <span class='cmp op'><=></span><span class='lparen token'>(</span><span class='rubyid_other identifier id'>other</span><span class='rparen token'>)</span> <span class='rubyid_raise identifier id'>raise</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_InvalidDataError constant id'>InvalidDataError</span><span class='comma token'>,</span> <span class='string val'>'Cannot compare with other classes'</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_other identifier id'>other</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='colon2 op'>::</span><span class='rubyid_Version constant id'>Version</span> <span class='rubyid_raise identifier id'>raise</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_InvalidDataError constant id'>InvalidDataError</span><span class='comma token'>,</span> <span class='string val'>'Cannot compare versions of different titles'</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_other identifier id'>other</span><span class='dot token'>.</span><span class='rubyid_title identifier id'>title</span> <span class='eq op'>==</span> <span class='rubyid_title identifier id'>title</span> <span class='rubyid_order_index identifier id'>order_index</span> <span class='cmp op'><=></span> <span class='rubyid_other identifier id'>other</span><span class='dot token'>.</span><span class='rubyid_order_index identifier id'>order_index</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="admin-instance_method"> #<strong>admin</strong> ⇒ <tt>String</tt> </h3><script> document.getElementById("admin-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:admin">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>This can be manually set earlier in the request handling to use a non-standard admin username</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>String</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 594 595 596</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 594</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_admin identifier id'>admin</span> <span class='rubyid_@admin ivar id'>@admin</span> <span class='opasgn op'>||=</span> <span class='rubyid_session identifier id'>session</span><span class='lbrack token'>[</span><span class='symbol val'>:admin</span><span class='rbrack token'>]</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="create-instance_method"> #<strong>create</strong> ⇒ <tt>void</tt> </h3><script> document.getElementById("create-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:create">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>Save a new version, adding to the local filesystem, Jamf Pro, and the Title Editor as needed This should be running in the context of #with_streaming</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 681</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_create identifier id'>create</span> <span class='rubyid_lock identifier id'>lock</span> <span class='rubyid_@current_action ivar id'>@current_action</span> <span class='assign token'>=</span> <span class='symbol val'>:creating</span> <span class='comment val'># NOTE: this for later in this method,</span> <span class='comment val'># since uploads are processed in separate threads</span> <span class='rubyid_pkg_upload_given identifier id'>pkg_upload_given</span> <span class='assign token'>=</span> <span class='notop op'>!</span><span class='rubyid_pkg_to_upload identifier id'>pkg_to_upload</span><span class='dot token'>.</span><span class='rubyid_pix_empty? fid id'>pix_empty?</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_creation_date identifier id'>creation_date</span> <span class='assign token'>=</span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_created_by identifier id'>created_by</span> <span class='assign token'>=</span> <span class='rubyid_admin identifier id'>admin</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_status identifier id'>status</span> <span class='assign token'>=</span> <span class='rubyid_STATUS_PENDING constant id'>STATUS_PENDING</span> <span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"creation_date: #{creation_date}, created_by: #{created_by}"</span> <span class='comment val'># save to file here so that we have something to delete if</span> <span class='comment val'># the next couple steps fail</span> <span class='rubyid_progress identifier id'>progress</span> <span class='string val'>'Saving version data to Xolo server'</span> <span class='rubyid_save_local_data identifier id'>save_local_data</span> <span class='rubyid_create_patch_in_ted identifier id'>create_patch_in_ted</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_subscribed? fid id'>subscribed?</span> <span class='rubyid_create_in_jamf identifier id'>create_in_jamf</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_status identifier id'>status</span> <span class='assign token'>=</span> <span class='rubyid_STATUS_PILOT constant id'>STATUS_PILOT</span> <span class='comment val'># save to file again now, because saving to TitleEd and Jamf will</span> <span class='comment val'># add some data</span> <span class='rubyid_save_local_data identifier id'>save_local_data</span> <span class='comment val'># prepend our version to the version_order array of the title</span> <span class='rubyid_progress identifier id'>progress</span> <span class='dstring node'>"Updating title version_order, prepending '#{version}'"</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:info</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_prepend_version identifier id'>prepend_version</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='rubyid_log_change identifier id'>log_change</span> <span class='label val'>msg:</span> <span class='string val'>'Version Created'</span> <span class='rubyid_progress identifier id'>progress</span> <span class='dstring node'>"Version '#{version}' of Title '#{title}' has been created in Xolo."</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:info</span> <span class='comment val'># all done unless we need to get a pkg via autopkg</span> <span class='comment val'># pkg upload from xadm will happen in a separate process,</span> <span class='comment val'># so we don't want to do it here in the create method</span> <span class='comment val'># do we have an uploaded pkg?</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_pkg_upload_given identifier id'>pkg_upload_given</span> <span class='rubyid_progress identifier id'>progress</span> <span class='dstring node'>"Pkg will be uploaded to xolo via xadm shortly, from path '#{pkg_to_upload}'"</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:info</span> <span class='comment val'># if we have an autopkg recipe and dir, get the .pkg and upload it to Jamf</span> <span class='rubyid_elsif elsif kw'>elsif</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_autopkg_enabled? fid id'>autopkg_enabled?</span> <span class='rubyid_handle_autopkg_during_create identifier id'>handle_autopkg_during_create</span> <span class='comment val'># otherwise tell someone we need a .pkg</span> <span class='rubyid_else else kw'>else</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='dstring node'>"No --pkg-to-upload given for version '#{version}' of title #{title}, and no autopkg recipe enabled. Please upload a pkg via xadm or enable autopkg for this title."</span> <span class='comment val'># no alert when subscribed because a better alert mesg is sent from add_version_via_subscription</span> <span class='rubyid_subscribed? fid id'>subscribed?</span> <span class='integer val'>? </span><span class='rubyid_progress identifier id'>progress</span><span class='lparen token'>(</span><span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:warn</span><span class='rparen token'>)</span> <span class='colon op'>:</span> <span class='rubyid_progress identifier id'>progress</span><span class='lparen token'>(</span><span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:warn</span><span class='comma token'>,</span> <span class='label val'>alert:</span> <span class='rubyid_true true kw'>true</span><span class='rparen token'>)</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_update_client_data identifier id'>update_client_data</span> <span class='rubyid_ensure ensure kw'>ensure</span> <span class='rubyid_unlock identifier id'>unlock</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="creating?-instance_method"> #<strong>creating?</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("creating?-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:creating%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns Are we creating this version?.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> — <div class='inline'><p>Are we creating this version?</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 475 476 477</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 475</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_creating? fid id'>creating?</span> <span class='rubyid_current_action identifier id'>current_action</span> <span class='eq op'>==</span> <span class='symbol val'>:creating</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="data_dir-instance_method"> #<strong>data_dir</strong> ⇒ <tt>Pathname</tt> </h3><script> document.getElementById("data_dir-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:data_dir">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The data directory for this version</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Pathname</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 637 638 639</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 637</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_data_dir identifier id'>data_dir</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_data_dir identifier id'>data_dir</span> <span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="data_file-instance_method"> #<strong>data_file</strong> ⇒ <tt>Pathname</tt> </h3><script> document.getElementById("data_file-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:data_file">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The JSON data file for this version</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Pathname</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 644 645 646</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 644</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_data_file identifier id'>data_file</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_data_file identifier id'>data_file</span> <span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="delete-instance_method"> #<strong>delete</strong>(update_title: true, deleting_title: false) ⇒ <tt>void</tt> </h3><script> document.getElementById("delete-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:delete">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>Delete the version</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>update_title</span> <span class='type'>(<tt>Boolean</tt>)</span> <em class="default">(defaults to: <tt>true</tt>)</em> — <div class='inline'><p>Update the title for this version to know the version is gone. Set this to false when the title itself is being deleted and calling this method.</p></div> </li> <li> <span class='name'>deleting_title</span> <span class='type'>(<tt>Boolean</tt>)</span> <em class="default">(defaults to: <tt>false</tt>)</em> — <div class='inline'><p>Is the title itself being deleted?</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 1037</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_delete identifier id'>delete</span><span class='lparen token'>(</span><span class='label val'>update_title:</span> <span class='rubyid_true true kw'>true</span><span class='comma token'>,</span> <span class='label val'>deleting_title:</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span> <span class='rubyid_lock identifier id'>lock</span> <span class='rubyid_@current_action ivar id'>@current_action</span> <span class='assign token'>=</span> <span class='symbol val'>:deleting</span> <span class='rubyid_delete_version_from_jamf identifier id'>delete_version_from_jamf</span> <span class='comment val'># NOTE: we no longer delete the patch from the Title Editor</span> <span class='comment val'># unless the whole title is being deleted, because</span> <span class='comment val'># patches may be needed for reporting purposes.</span> <span class='comment val'># When the title is deleted, the title's delete method</span> <span class='comment val'># will delete all patches for all versions.</span> <span class='comment val'># If other situations arise where we need to delete</span> <span class='comment val'># ted patches individually, set deleting_title to true.</span> <span class='rubyid_delete_patch_from_ted identifier id'>delete_patch_from_ted</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_deleting_title identifier id'>deleting_title</span> <span class='andop op'>&&</span> <span class='rubyid_managed? fid id'>managed?</span> <span class='comment val'># remove from the title's list of versions</span> <span class='rubyid_progress identifier id'>progress</span> <span class='string val'>'Deleting version from title data on the Xolo server'</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:debug</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_remove_version identifier id'>remove_version</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_update_title identifier id'>update_title</span> <span class='comment val'># delete the local data</span> <span class='rubyid_progress identifier id'>progress</span> <span class='string val'>'Deleting version data from the Xolo server'</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:info</span> <span class='rubyid_data_dir identifier id'>data_dir</span><span class='dot token'>.</span><span class='rubyid_rmtree identifier id'>rmtree</span> <span class='rubyid_log_change identifier id'>log_change</span> <span class='label val'>msg:</span> <span class='string val'>'Version Deleted'</span> <span class='rubyid_progress identifier id'>progress</span> <span class='dstring node'>"Version '#{version}' of Title '#{title}' has been deleted from Xolo."</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:info</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_update_client_data identifier id'>update_client_data</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_deleting_title identifier id'>deleting_title</span> <span class='rubyid_ensure ensure kw'>ensure</span> <span class='rubyid_unlock identifier id'>unlock</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="deleting?-instance_method"> #<strong>deleting?</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("deleting?-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:deleting%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns Are we deleting this version?.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> — <div class='inline'><p>Are we deleting this version?</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 493 494 495</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 493</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_deleting? fid id'>deleting?</span> <span class='rubyid_current_action identifier id'>current_action</span> <span class='eq op'>==</span> <span class='symbol val'>:deleting</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="deprecate-instance_method"> #<strong>deprecate</strong> ⇒ <tt>void</tt> </h3><script> document.getElementById("deprecate-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:deprecate">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>deprecate this version</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 931 932 933 934 935 936 937 938 939 940 941 942 943</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 931</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_deprecate identifier id'>deprecate</span> <span class='rubyid_lock identifier id'>lock</span> <span class='rubyid_progress identifier id'>progress</span> <span class='dstring node'>"Deprecating older released version '#{version}'"</span> <span class='rubyid_disable_policies_for_deprecation_or_skipping identifier id'>disable_policies_for_deprecation_or_skipping</span> <span class='symbol val'>:deprecated</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_status identifier id'>status</span> <span class='assign token'>=</span> <span class='rubyid_STATUS_DEPRECATED constant id'>STATUS_DEPRECATED</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_deprecation_date identifier id'>deprecation_date</span> <span class='assign token'>=</span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_deprecated_by identifier id'>deprecated_by</span> <span class='assign token'>=</span> <span class='rubyid_admin identifier id'>admin</span> <span class='rubyid_log_change identifier id'>log_change</span> <span class='label val'>msg:</span> <span class='string val'>'Version Deprecated'</span> <span class='rubyid_save_local_data identifier id'>save_local_data</span> <span class='rubyid_ensure ensure kw'>ensure</span> <span class='rubyid_unlock identifier id'>unlock</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="excluded_groups_to_use-instance_method"> #<strong>excluded_groups_to_use</strong>(ttl_obj: nil) ⇒ <tt>Array<String></tt> </h3><script> document.getElementById("excluded_groups_to_use-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:excluded_groups_to_use">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The scope excluded groups to use in policies and patch policies for all versions of this title.</p> <p>Excluded groups are defined in the title, applying to all versions, and may be augmented by:</p> <ul> <li>A smart group of computers NOT in the target_groups, if any target groups are defined.</li> <li>Xolo::Server.config.forced_exclusion, a group excluded from ALL of xolo, defined in the server config.</li> <li>The title's jamf_frozen_group_name, if it exists, containing computers that have been 'frozen' to a single version.</li> </ul> <p>For initial install policies, the smart group of macs with any version installed (jamf_installed_group_name) "xolo-<title>-installed" is also excluded, because otherwise the initial-install policies would stomp on the patch policies.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>ttl_obj</span> <span class='type'>(<tt><span class='object_link'><a href="/gems/xolo-server/2.3.0/Xolo/Server/Title" title="Xolo::Server::Title (class)">Xolo::Server::Title</a></span></tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The pre-instantiated title for ths version. if nil, we'll instantiate it now</p></div> </li> </ul> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Array<String></tt>)</span> — <div class='inline'><p>the excluded groups to use</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 543</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_excluded_groups_to_use identifier id'>excluded_groups_to_use</span><span class='lparen token'>(</span><span class='label val'>ttl_obj:</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_@excluded_groups_to_use ivar id'>@excluded_groups_to_use</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_@excluded_groups_to_use ivar id'>@excluded_groups_to_use</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span> <span class='opasgn op'>||=</span> <span class='rubyid_title_object identifier id'>title_object</span> <span class='comment val'># always exclude the frozen static group</span> <span class='comment val'># calling ttl_obj.jamf_frozen_group will create the group if needed</span> <span class='rubyid_@excluded_groups_to_use ivar id'>@excluded_groups_to_use</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rubyid_ttl_obj identifier id'>ttl_obj</span><span class='dot token'>.</span><span class='rubyid_jamf_frozen_group identifier id'>jamf_frozen_group</span><span class='dot token'>.</span><span class='rubyid_name identifier id'>name</span><span class='rbrack token'>]</span> <span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Added '#{ttl_obj.jamf_frozen_group_name}' to @excluded_groups_to_use"</span> <span class='comment val'># get the excluded groups from the title</span> <span class='rubyid_@excluded_groups_to_use ivar id'>@excluded_groups_to_use</span> <span class='opasgn op'>+=</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span><span class='dot token'>.</span><span class='rubyid_changes_for_update identifier id'>changes_for_update</span><span class='bitand op'>&</span><span class='dot token'>.</span><span class='rubyid_key? fid id'>key?</span><span class='lparen token'>(</span><span class='symbol val'>:excluded_groups</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span><span class='dot token'>.</span><span class='rubyid_changes_for_update identifier id'>changes_for_update</span><span class='lbrack token'>[</span><span class='symbol val'>:excluded_groups</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='symbol val'>:new</span><span class='rbrack token'>]</span> <span class='colon op'>:</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span><span class='dot token'>.</span><span class='rubyid_excluded_groups identifier id'>excluded_groups</span> <span class='comment val'># add the jamf_target_groups_exclusion_group - it must have been created before now</span> <span class='rubyid_@excluded_groups_to_use ivar id'>@excluded_groups_to_use</span> <span class='lshft op'><<</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span><span class='dot token'>.</span><span class='rubyid_jamf_target_groups_exclusion_group_name identifier id'>jamf_target_groups_exclusion_group_name</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span><span class='dot token'>.</span><span class='rubyid_use_jamf_target_groups_exclusion_group? fid id'>use_jamf_target_groups_exclusion_group?</span> <span class='comment val'># always exclude Xolo::Server.config.forced_exclusion if defined</span> <span class='rubyid_@excluded_groups_to_use ivar id'>@excluded_groups_to_use</span> <span class='lshft op'><<</span> <span class='rubyid_valid_forced_exclusion_group_name identifier id'>valid_forced_exclusion_group_name</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_valid_forced_exclusion_group_name identifier id'>valid_forced_exclusion_group_name</span> <span class='rubyid_@excluded_groups_to_use ivar id'>@excluded_groups_to_use</span><span class='dot token'>.</span><span class='rubyid_uniq! fid id'>uniq!</span> <span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Excluded groups to use: #{@excluded_groups_to_use.join ', '}"</span> <span class='rubyid_@excluded_groups_to_use ivar id'>@excluded_groups_to_use</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="handle_autopkg_during_create-instance_method"> #<strong>handle_autopkg_during_create</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("handle_autopkg_during_create-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:handle_autopkg_during_create">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Do autopkg stuff during creation</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 746</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_handle_autopkg_during_create identifier id'>handle_autopkg_during_create</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_autopkg_enabled? fid id'>autopkg_enabled?</span> <span class='rubyid_pkg_src identifier id'>pkg_src</span> <span class='assign token'>=</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_run_autopkg_recipe identifier id'>run_autopkg_recipe</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_pkg_src identifier id'>pkg_src</span><span class='dot token'>.</span><span class='rubyid_nil? fid id'>nil?</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='string val'>'AutoPkg recipe is enabled for this title, but no pkg was found after running the recipe. Please check the AutoPkg recipe and the server log for details.'</span> <span class='rubyid_progress identifier id'>progress</span> <span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:warn</span><span class='comma token'>,</span> <span class='label val'>alert:</span> <span class='rubyid_true true kw'>true</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_oldest_allowed identifier id'>oldest_allowed</span> <span class='assign token'>=</span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span> <span class='minus op'>-</span> <span class='integer val'>1200</span> <span class='comment val'># 20 minutes ago</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_pkg_src identifier id'>pkg_src</span><span class='dot token'>.</span><span class='rubyid_mtime identifier id'>mtime</span> <span class='lt op'><</span> <span class='rubyid_oldest_allowed identifier id'>oldest_allowed</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='dstring node'>"AutoPkg recipe is enabled for this title, and a pkg was found after running the recipe, but it was last modified at #{pkg_src.mtime}, which is more than 20 minutes ago. To avoid accidentally uploading an old pkg, the server will not upload this pkg. Please check the AutoPkg recipe and the server log for details."</span> <span class='rubyid_progress identifier id'>progress</span> <span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:warn</span><span class='comma token'>,</span> <span class='label val'>alert:</span> <span class='rubyid_true true kw'>true</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_end end kw'>end</span> <span class='comment val'># this lets future code know that the pkg we're working with came from autopkg</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_pkg_is_from_autopkg identifier id'>pkg_is_from_autopkg</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span> <span class='comment val'># Upload the pkg to Jamf, and associate it with this version</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_process_and_upload_autopkg_pkg identifier id'>process_and_upload_autopkg_pkg</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_self self kw'>self</span><span class='comma token'>,</span> <span class='rubyid_pkg_src identifier id'>pkg_src</span><span class='rparen token'>)</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="jamf_cnx-instance_method"> #<strong>jamf_cnx</strong>(refresh: false) ⇒ <tt>Jamf::Connection</tt> </h3><script> document.getElementById("jamf_cnx-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:jamf_cnx">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns a single Jamf Pro API connection to use for the life of this instance.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Jamf::Connection</tt>)</span> — <div class='inline'><p>a single Jamf Pro API connection to use for the life of this instance</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 630 631 632</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 630</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_jamf_cnx identifier id'>jamf_cnx</span><span class='lparen token'>(</span><span class='label val'>refresh:</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_jamf_cnx identifier id'>jamf_cnx</span> <span class='label val'>refresh:</span> <span class='rubyid_refresh identifier id'>refresh</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="lock-instance_method"> #<strong>lock</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("lock-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:lock">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Lock this version for updates</p> </div> </div> <div class="tags"> <p class="tag_title">Raises:</p> <ul class="raise"> <li> <span class='type'>(<tt>Xolo::ServerError</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 1076</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_lock identifier id'>lock</span> <span class='rubyid_raise identifier id'>raise</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_ServerError constant id'>ServerError</span><span class='comma token'>,</span> <span class='string val'>'Server is shutting down'</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='dot token'>.</span><span class='rubyid_shutting_down? fid id'>shutting_down?</span> <span class='rubyid_while while kw'>while</span> <span class='rubyid_locked? fid id'>locked?</span> <span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span><span class='dot token'>.</span><span class='rubyid_to_i identifier id'>to_i</span> <span class='mod op'>%</span> <span class='integer val'>5</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_zero? fid id'>zero?</span> <span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Method #{caller_locations.first.label} is waiting for update lock on Version '#{version}' of title '#{title}'..."</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_sleep identifier id'>sleep</span> <span class='integer val'>0</span><span class='integer val'>.33</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='dot token'>.</span><span class='rubyid_object_locks identifier id'>object_locks</span><span class='lbrack token'>[</span><span class='rubyid_title identifier id'>title</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span> <span class='label val'>versions:</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span> <span class='rbrace token'>}</span> <span class='rubyid_exp identifier id'>exp</span> <span class='assign token'>=</span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span> <span class='plus op'>+</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='colon2 op'>::</span><span class='rubyid_ObjectLocks constant id'>ObjectLocks</span><span class='colon2 op'>::</span><span class='rubyid_OBJECT_LOCK_LIMIT constant id'>OBJECT_LOCK_LIMIT</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='dot token'>.</span><span class='rubyid_object_locks identifier id'>object_locks</span><span class='lbrack token'>[</span><span class='rubyid_title identifier id'>title</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='symbol val'>:versions</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_version identifier id'>version</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_exp identifier id'>exp</span> <span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Locked version '#{version}' of title '#{title}' for updates until #{exp}, by method #{caller_locations.first.label}"</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="locked?-instance_method"> #<strong>locked?</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("locked?-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:locked%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Is this version locked for updates?</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 1070 1071 1072</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 1070</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_locked? fid id'>locked?</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_locked? fid id'>locked?</span><span class='lparen token'>(</span><span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="managed?-instance_method"> #<strong>managed?</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("managed?-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:managed%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>or a managed title?</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 777 778 779</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 777</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_managed? fid id'>managed?</span> <span class='notop op'>!</span><span class='rubyid_subscribed? fid id'>subscribed?</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="manifest_file-instance_method"> #<strong>manifest_file</strong> ⇒ <tt>Pathname</tt> </h3><script> document.getElementById("manifest_file-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:manifest_file">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The manifest plist file for this version</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Pathname</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 651 652 653</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 651</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_manifest_file identifier id'>manifest_file</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_class identifier id'>class</span><span class='dot token'>.</span><span class='rubyid_manifest_file identifier id'>manifest_file</span> <span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="order_index-instance_method"> #<strong>order_index</strong> ⇒ <tt>Integer</tt> </h3><script> document.getElementById("order_index-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:order_index">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns The index of this version in the title's reversed version_order array. We reverse it because the version_order array holds the newest versions first, so the index of the newest version is 0, the next newest is 1, etc - we need the opposite of that.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Integer</tt>)</span> — <div class='inline'><p>The index of this version in the title's reversed version_order array. We reverse it because the version_order array holds the newest versions first, so the index of the newest version is 0, the next newest is 1, etc - we need the opposite of that.</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 469 470 471</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 469</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_order_index identifier id'>order_index</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_version_order identifier id'>version_order</span><span class='dot token'>.</span><span class='rubyid_reverse identifier id'>reverse</span><span class='dot token'>.</span><span class='rubyid_index identifier id'>index</span> <span class='rubyid_version identifier id'>version</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="pilot_groups_to_use-instance_method"> #<strong>pilot_groups_to_use</strong> ⇒ <tt>Array<String></tt> </h3><script> document.getElementById("pilot_groups_to_use-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:pilot_groups_to_use">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The scope target groups to use in policies and patch policies during pilot This is defined in each version, and inherited when new versions are created.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Array<String></tt>)</span> — <div class='inline'><p>the pilot groups to use</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 508</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_pilot_groups_to_use identifier id'>pilot_groups_to_use</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_@pilot_groups_to_use ivar id'>@pilot_groups_to_use</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_@pilot_groups_to_use ivar id'>@pilot_groups_to_use</span> <span class='comment val'># any defined in the version override any in the title</span> <span class='rubyid_@pilot_groups_to_use ivar id'>@pilot_groups_to_use</span> <span class='assign token'>=</span> <span class='rubyid_changes_for_update identifier id'>changes_for_update</span><span class='bitand op'>&</span><span class='dot token'>.</span><span class='rubyid_key? fid id'>key?</span><span class='lparen token'>(</span><span class='symbol val'>:pilot_groups</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_changes_for_update identifier id'>changes_for_update</span><span class='lbrack token'>[</span><span class='symbol val'>:pilot_groups</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='symbol val'>:new</span><span class='rbrack token'>]</span> <span class='colon op'>:</span> <span class='rubyid_pilot_groups identifier id'>pilot_groups</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_@pilot_groups_to_use ivar id'>@pilot_groups_to_use</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_@pilot_groups_to_use ivar id'>@pilot_groups_to_use</span><span class='dot token'>.</span><span class='rubyid_empty? fid id'>empty?</span> <span class='comment val'># if none defined in the version, look in the title</span> <span class='rubyid_@pilot_groups_to_use ivar id'>@pilot_groups_to_use</span> <span class='assign token'>=</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_changes_for_update identifier id'>changes_for_update</span><span class='bitand op'>&</span><span class='dot token'>.</span><span class='rubyid_key? fid id'>key?</span><span class='lparen token'>(</span><span class='symbol val'>:pilot_groups</span><span class='rparen token'>)</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_changes_for_update identifier id'>changes_for_update</span><span class='lbrack token'>[</span><span class='symbol val'>:pilot_groups</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='symbol val'>:new</span><span class='rbrack token'>]</span> <span class='rubyid_else else kw'>else</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_pilot_groups identifier id'>pilot_groups</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="progress-instance_method"> #<strong>progress</strong>(msg, log: :debug, alert: false) ⇒ <tt>void</tt> </h3><script> document.getElementById("progress-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:progress">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>Append a message to the progress stream file, optionally sending it also to the log</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>message</span> <span class='type'>(<tt>String</tt>)</span> — <div class='inline'><p>the message to append</p></div> </li> <li> <span class='name'>log</span> <span class='type'>(<tt>Symbol</tt>)</span> <em class="default">(defaults to: <tt>:debug</tt>)</em> — <div class='inline'><p>the level at which to log the message one of :debug, :info, :warn, :error, :fatal, or :unknown. Default is nil, which doesn't log the message at all.</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 608 609 610</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 608</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_progress identifier id'>progress</span><span class='lparen token'>(</span><span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:debug</span><span class='comma token'>,</span> <span class='label val'>alert:</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_progress identifier id'>progress</span> <span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='rubyid_log identifier id'>log</span><span class='comma token'>,</span> <span class='label val'>alert:</span> <span class='rubyid_alert identifier id'>alert</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="release-instance_method"> #<strong>release</strong>(rollback:) ⇒ <tt>void</tt> </h3><script> document.getElementById("release-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:release">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>Release this version, possibly rolling back from a previously newer version This should only be called by the title. The initial 'release' action starts in the title, and then calls this method on the version to do the version-specific release steps.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>rollback</span> <span class='type'>(<tt>Boolean</tt>)</span> — <div class='inline'><p>If true, this version is being released as a rollback</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 887</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_release identifier id'>release</span><span class='lparen token'>(</span><span class='label val'>rollback:</span><span class='rparen token'>)</span> <span class='rubyid_lock identifier id'>lock</span> <span class='rubyid_@current_action ivar id'>@current_action</span> <span class='assign token'>=</span> <span class='symbol val'>:releasing</span> <span class='comment val'># set scope targets of auto-install policy to release-groups</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='dstring node'>"Jamf: Version '#{version}': Setting scope targets of auto-install policy to release_groups: #{release_groups_to_use.join(', ')}"</span> <span class='rubyid_progress identifier id'>progress</span> <span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:info</span> <span class='rubyid_pol identifier id'>pol</span> <span class='assign token'>=</span> <span class='rubyid_jamf_auto_install_policy identifier id'>jamf_auto_install_policy</span> <span class='rubyid_set_policy_release_groups identifier id'>set_policy_release_groups</span> <span class='rubyid_pol identifier id'>pol</span> <span class='rubyid_pol identifier id'>pol</span><span class='dot token'>.</span><span class='rubyid_enable identifier id'>enable</span> <span class='rubyid_pol identifier id'>pol</span><span class='dot token'>.</span><span class='rubyid_save identifier id'>save</span> <span class='comment val'># set scope targets of patch policy to all (in patch pols, 'all' means 'all eligible')</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='dstring node'>"Jamf: Version '#{version}': Setting scope targets of patch policy to all eligible computers"</span> <span class='rubyid_progress identifier id'>progress</span> <span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:info</span> <span class='rubyid_ppol identifier id'>ppol</span> <span class='assign token'>=</span> <span class='rubyid_jamf_patch_policy identifier id'>jamf_patch_policy</span> <span class='rubyid_ppol identifier id'>ppol</span><span class='dot token'>.</span><span class='rubyid_enable identifier id'>enable</span> <span class='rubyid_ppol identifier id'>ppol</span><span class='dot token'>.</span><span class='rubyid_scope identifier id'>scope</span><span class='dot token'>.</span><span class='rubyid_set_all_targets identifier id'>set_all_targets</span> <span class='comment val'># if rollback, make sure the patch policy is set to 'allow downgrade'</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_rollback identifier id'>rollback</span> <span class='rubyid_msg identifier id'>msg</span> <span class='assign token'>=</span> <span class='dstring node'>"Jamf: Version '#{version}': Setting patch policy to allow downgrade"</span> <span class='rubyid_progress identifier id'>progress</span> <span class='rubyid_msg identifier id'>msg</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:info</span> <span class='rubyid_ppol identifier id'>ppol</span><span class='dot token'>.</span><span class='rubyid_allow_downgrade identifier id'>allow_downgrade</span> <span class='assign token'>=</span> <span class='rubyid_true true kw'>true</span> <span class='rubyid_else else kw'>else</span> <span class='rubyid_ppol identifier id'>ppol</span><span class='dot token'>.</span><span class='rubyid_allow_downgrade identifier id'>allow_downgrade</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_ppol identifier id'>ppol</span><span class='dot token'>.</span><span class='rubyid_save identifier id'>save</span> <span class='comment val'># change status to 'released'</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_status identifier id'>status</span> <span class='assign token'>=</span> <span class='rubyid_STATUS_RELEASED constant id'>STATUS_RELEASED</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_release_date identifier id'>release_date</span> <span class='assign token'>=</span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_released_by identifier id'>released_by</span> <span class='assign token'>=</span> <span class='rubyid_admin identifier id'>admin</span> <span class='rubyid_chg_msg identifier id'>chg_msg</span> <span class='assign token'>=</span> <span class='rubyid_rollback identifier id'>rollback</span> <span class='integer val'>? </span><span class='string val'>'Version Released - Rolled Back'</span> <span class='colon op'>:</span> <span class='string val'>'Version Released'</span> <span class='rubyid_log_change identifier id'>log_change</span> <span class='label val'>msg:</span> <span class='rubyid_chg_msg identifier id'>chg_msg</span> <span class='rubyid_save_local_data identifier id'>save_local_data</span> <span class='rubyid_ensure ensure kw'>ensure</span> <span class='rubyid_unlock identifier id'>unlock</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="release_groups_to_use-instance_method"> #<strong>release_groups_to_use</strong>(ttl_obj: nil) ⇒ <tt>Array<String></tt> </h3><script> document.getElementById("release_groups_to_use-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:release_groups_to_use">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>The scope target groups to use in policies and patch policies when the version is released This is defined in the title and applies to all versions.</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>ttl_obj</span> <span class='type'>(<tt><span class='object_link'><a href="/gems/xolo-server/2.3.0/Xolo/Server/Title" title="Xolo::Server::Title (class)">Xolo::Server::Title</a></span></tt>)</span> <em class="default">(defaults to: <tt>nil</tt>)</em> — <div class='inline'><p>The pre-instantiated title for ths version. if nil, we'll instantiate it now</p></div> </li> </ul> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Array<String></tt>)</span> — <div class='inline'><p>the target groups to use</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 576 577 578 579 580 581</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 576</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_release_groups_to_use identifier id'>release_groups_to_use</span><span class='lparen token'>(</span><span class='label val'>ttl_obj:</span> <span class='rubyid_nil nil kw'>nil</span><span class='rparen token'>)</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_@release_groups_to_use ivar id'>@release_groups_to_use</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_@release_groups_to_use ivar id'>@release_groups_to_use</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span> <span class='opasgn op'>||=</span> <span class='rubyid_title_object identifier id'>title_object</span> <span class='rubyid_@release_groups_to_use ivar id'>@release_groups_to_use</span> <span class='assign token'>=</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span><span class='dot token'>.</span><span class='rubyid_changes_for_update identifier id'>changes_for_update</span><span class='bitand op'>&</span><span class='dot token'>.</span><span class='rubyid_key? fid id'>key?</span><span class='lparen token'>(</span><span class='symbol val'>:release_groups</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span><span class='dot token'>.</span><span class='rubyid_changes_for_update identifier id'>changes_for_update</span><span class='lbrack token'>[</span><span class='symbol val'>:release_groups</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='symbol val'>:new</span><span class='rbrack token'>]</span> <span class='colon op'>:</span> <span class='rubyid_ttl_obj identifier id'>ttl_obj</span><span class='dot token'>.</span><span class='rubyid_release_groups identifier id'>release_groups</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="releasing?-instance_method"> #<strong>releasing?</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("releasing?-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:releasing%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns Are we releasing this version?.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> — <div class='inline'><p>Are we releasing this version?</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 499 500 501</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 499</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_releasing? fid id'>releasing?</span> <span class='rubyid_current_action identifier id'>current_action</span> <span class='eq op'>==</span> <span class='symbol val'>:releasing</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="repair-instance_method"> #<strong>repair</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("repair-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:repair">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Repair this version. Look at the Title Editor patch object, and ensure it's correct based on the local data file.</p> <ul> <li>version order</li> <li>min os</li> <li>max os</li> <li>standalone</li> <li>reboot</li> <li>release date</li> <li>killapps</li> <li>component criteria <ul> <li>component name '<title>'</li> </ul> </li> <li>capability criteria</li> <li>enabled</li> </ul> <p>Then look at the various Jamf objects pertaining to this version, and ensure they are correct</p> <ul> <li>package object 'xolo-<title>-<version>' <ul> <li>filename 'xolo-<title>-<version>.pkg'</li> <li>description</li> <li>os limitations</li> </ul> </li> <li>auto install policy 'xolo-<title>-<version>-auto-install'</li> <li>manual install policy 'xolo-<title>-<version>-manual-install'</li> <li>patch policy 'xolo-<title>-<version>'</li> </ul> <p>Then look at the xolo metadata, and fix whatever is needed</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 847</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_repair identifier id'>repair</span> <span class='rubyid_lock identifier id'>lock</span> <span class='rubyid_@current_action ivar id'>@current_action</span> <span class='assign token'>=</span> <span class='symbol val'>:repairing</span> <span class='rubyid_log_change identifier id'>log_change</span> <span class='label val'>msg:</span> <span class='dstring node'>"Repairing version '#{version}'"</span> <span class='rubyid_progress identifier id'>progress</span> <span class='dstring node'>"Starting repair of version '#{version}' of title '#{title}'"</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:debug</span> <span class='rubyid_repair_ted_patch identifier id'>repair_ted_patch</span> <span class='rubyid_repair_jamf_version_objects identifier id'>repair_jamf_version_objects</span> <span class='comment val'># If there's a reupload, but no original, make the orig the same as the re</span> <span class='rubyid_unless unless kw'>unless</span> <span class='rubyid_upload_date identifier id'>upload_date</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_reupload_date identifier id'>reupload_date</span> <span class='andop op'>&&</span> <span class='rubyid_reuploaded_by identifier id'>reuploaded_by</span> <span class='rubyid_new_date identifier id'>new_date</span> <span class='assign token'>=</span> <span class='rubyid_reupload_date identifier id'>reupload_date</span> <span class='rubyid_new_by identifier id'>new_by</span> <span class='assign token'>=</span> <span class='rubyid_reuploaded_by identifier id'>reuploaded_by</span> <span class='rubyid_else else kw'>else</span> <span class='rubyid_new_date identifier id'>new_date</span> <span class='assign token'>=</span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_parse identifier id'>parse</span> <span class='string val'>'2025-02-15'</span> <span class='rubyid_new_by identifier id'>new_by</span> <span class='assign token'>=</span> <span class='string val'>'buzzlightyear'</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_progress identifier id'>progress</span> <span class='dstring node'>"Fixing original upload date: #{new_date}, by: #{new_by}"</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:debug</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_upload_date identifier id'>upload_date</span> <span class='assign token'>=</span> <span class='rubyid_new_date identifier id'>new_date</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_uploaded_by identifier id'>uploaded_by</span> <span class='assign token'>=</span> <span class='rubyid_new_by identifier id'>new_by</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_save_local_data identifier id'>save_local_data</span> <span class='comment val'># no need to update client data now if we're being repaired along with our title</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_current_action identifier id'>current_action</span> <span class='eq op'>==</span> <span class='symbol val'>:repairing</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_update_client_data identifier id'>update_client_data</span> <span class='rubyid_ensure ensure kw'>ensure</span> <span class='rubyid_unlock identifier id'>unlock</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="repairing?-instance_method"> #<strong>repairing?</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("repairing?-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:repairing%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns Are we repairing this version?.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> — <div class='inline'><p>Are we repairing this version?</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 487 488 489</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 487</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_repairing? fid id'>repairing?</span> <span class='rubyid_current_action identifier id'>current_action</span> <span class='eq op'>==</span> <span class='symbol val'>:repairing</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="reset_to_pilot-instance_method"> #<strong>reset_to_pilot</strong> ⇒ <tt>void</tt> </h3><script> document.getElementById("reset_to_pilot-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:reset_to_pilot">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>Reset this version to 'pilot' status, since we are rolling back to a previous version</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 967</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_reset_to_pilot identifier id'>reset_to_pilot</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_status identifier id'>status</span> <span class='eq op'>==</span> <span class='rubyid_STATUS_PILOT constant id'>STATUS_PILOT</span> <span class='rubyid_lock identifier id'>lock</span> <span class='rubyid_progress identifier id'>progress</span> <span class='dstring node'>"Resetting version '#{version}' to pilot status due to rollback of an older version"</span> <span class='rubyid_reset_policies_to_pilot identifier id'>reset_policies_to_pilot</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_status identifier id'>status</span> <span class='assign token'>=</span> <span class='rubyid_STATUS_PILOT constant id'>STATUS_PILOT</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_skipped_date identifier id'>skipped_date</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_skipped_by identifier id'>skipped_by</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_deprecation_date identifier id'>deprecation_date</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_deprecated_by identifier id'>deprecated_by</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span> <span class='rubyid_log_change identifier id'>log_change</span> <span class='label val'>msg:</span> <span class='string val'>'Version Reset to Pilot'</span> <span class='rubyid_save_local_data identifier id'>save_local_data</span> <span class='rubyid_ensure ensure kw'>ensure</span> <span class='rubyid_unlock identifier id'>unlock</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="save_local_data-instance_method"> #<strong>save_local_data</strong> ⇒ <tt>void</tt> </h3><script> document.getElementById("save_local_data-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:save_local_data">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>Save our current data out to our JSON data file This overwrites the existing data.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 1015</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_save_local_data identifier id'>save_local_data</span> <span class='rubyid_data_dir identifier id'>data_dir</span><span class='dot token'>.</span><span class='rubyid_mkpath identifier id'>mkpath</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_modification_date identifier id'>modification_date</span> <span class='assign token'>=</span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_modified_by identifier id'>modified_by</span> <span class='assign token'>=</span> <span class='rubyid_admin identifier id'>admin</span> <span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Version '#{version}' of Title '#{title}' noting modification by #{modified_by}"</span> <span class='rubyid_file identifier id'>file</span> <span class='assign token'>=</span> <span class='rubyid_data_file identifier id'>data_file</span> <span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Saving local version data to: #{file}"</span> <span class='rubyid_file identifier id'>file</span><span class='dot token'>.</span><span class='rubyid_pix_atomic_write identifier id'>pix_atomic_write</span> <span class='rubyid_to_json identifier id'>to_json</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="session-instance_method"> #<strong>session</strong> ⇒ <tt>Hash</tt> </h3><script> document.getElementById("session-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:session">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Hash</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 585 586 587 588</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 585</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_session identifier id'>session</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='bitand op'>&</span><span class='dot token'>.</span><span class='rubyid_session identifier id'>session</span> <span class='orop op'>||</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span> <span class='comment val'># @session ||= {}</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="skip-instance_method"> #<strong>skip</strong> ⇒ <tt>void</tt> </h3><script> document.getElementById("skip-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:skip">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>skip this version</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 949 950 951 952 953 954 955 956 957 958 959 960</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 949</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_skip identifier id'>skip</span> <span class='rubyid_lock identifier id'>lock</span> <span class='rubyid_progress identifier id'>progress</span> <span class='dstring node'>"Skipping unreleased version '#{version}'"</span> <span class='rubyid_disable_policies_for_deprecation_or_skipping identifier id'>disable_policies_for_deprecation_or_skipping</span> <span class='symbol val'>:skipped</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_status identifier id'>status</span> <span class='assign token'>=</span> <span class='rubyid_STATUS_SKIPPED constant id'>STATUS_SKIPPED</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_skipped_date identifier id'>skipped_date</span> <span class='assign token'>=</span> <span class='rubyid_Time constant id'>Time</span><span class='dot token'>.</span><span class='rubyid_now identifier id'>now</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_skipped_by identifier id'>skipped_by</span> <span class='assign token'>=</span> <span class='rubyid_admin identifier id'>admin</span> <span class='rubyid_log_change identifier id'>log_change</span> <span class='label val'>msg:</span> <span class='string val'>'Version Skipped'</span> <span class='rubyid_save_local_data identifier id'>save_local_data</span> <span class='rubyid_ensure ensure kw'>ensure</span> <span class='rubyid_unlock identifier id'>unlock</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="subscribed?-instance_method"> #<strong>subscribed?</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("subscribed?-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:subscribed%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Is this version part of a subscribed title?</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 772 773 774</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 772</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_subscribed? fid id'>subscribed?</span> <span class='rubyid_title_object identifier id'>title_object</span><span class='dot token'>.</span><span class='rubyid_subscribed? fid id'>subscribed?</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="ted_cnx-instance_method"> #<strong>ted_cnx</strong> ⇒ <tt>Windoo::Connection</tt> </h3><script> document.getElementById("ted_cnx-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:ted_cnx">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns a single Title Editor connection to use for the life of this instance.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Windoo::Connection</tt>)</span> — <div class='inline'><p>a single Title Editor connection to use for the life of this instance</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 623 624 625</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 623</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_ted_cnx identifier id'>ted_cnx</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_ted_cnx identifier id'>ted_cnx</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="ted_patch-instance_method"> #<strong>ted_patch</strong>(refresh: false) ⇒ <tt>Windoo::Patch</tt> </h3><script> document.getElementById("ted_patch-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:ted_patch">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>TODO: maybe pass in an appropriate Windoo::SoftwareTitle, so we don't have to use refresh all the time to re-fetch, if we just re-fetched from elsewhere?</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Windoo::Patch</tt>)</span> — <div class='inline'><p>The Windoo::Patch object that represents this version in the title editor</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 662 663 664 665</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 662</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_ted_patch identifier id'>ted_patch</span><span class='lparen token'>(</span><span class='label val'>refresh:</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span> <span class='rubyid_@ted_patch ivar id'>@ted_patch</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_refresh identifier id'>refresh</span> <span class='rubyid_@ted_patch ivar id'>@ted_patch</span> <span class='opasgn op'>||=</span> <span class='rubyid_ted_title identifier id'>ted_title</span><span class='lparen token'>(</span><span class='label val'>refresh:</span> <span class='rubyid_refresh identifier id'>refresh</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_patches identifier id'>patches</span><span class='dot token'>.</span><span class='rubyid_patch identifier id'>patch</span><span class='lparen token'>(</span><span class='rubyid_version identifier id'>version</span><span class='rparen token'>)</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="ted_title-instance_method"> #<strong>ted_title</strong>(refresh: false) ⇒ <tt>Windoo::SoftwareTitle</tt> </h3><script> document.getElementById("ted_title-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:ted_title">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns The Windoo::SoftwareTitle object that represents this version's title in the title editor.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Windoo::SoftwareTitle</tt>)</span> — <div class='inline'><p>The Windoo::SoftwareTitle object that represents this version's title in the title editor</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 670 671 672 673</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 670</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_ted_title identifier id'>ted_title</span><span class='lparen token'>(</span><span class='label val'>refresh:</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span> <span class='rubyid_@ted_title ivar id'>@ted_title</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_refresh identifier id'>refresh</span> <span class='rubyid_@ted_title ivar id'>@ted_title</span> <span class='opasgn op'>||=</span> <span class='rubyid_Windoo constant id'>Windoo</span><span class='colon2 op'>::</span><span class='rubyid_SoftwareTitle constant id'>SoftwareTitle</span><span class='dot token'>.</span><span class='rubyid_fetch identifier id'>fetch</span> <span class='label val'>id:</span> <span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='label val'>cnx:</span> <span class='rubyid_ted_cnx identifier id'>ted_cnx</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="to_h-instance_method"> #<strong>to_h</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("to_h-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:to_h">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Add more data to our hash</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 1104</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_to_h identifier id'>to_h</span> <span class='rubyid_hash identifier id'>hash</span> <span class='assign token'>=</span> <span class='rubyid_super super kw'>super</span> <span class='comment val'># These attrs aren't defined in the ATTRIBUTES</span> <span class='comment val'># but we want them in the hash and/or JSON</span> <span class='rubyid_hash identifier id'>hash</span><span class='lbrack token'>[</span><span class='symbol val'>:jamf_pkg_id</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_jamf_pkg_id identifier id'>jamf_pkg_id</span> <span class='rubyid_hash identifier id'>hash</span><span class='lbrack token'>[</span><span class='symbol val'>:ted_id_number</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_ted_id_number identifier id'>ted_id_number</span> <span class='rubyid_hash identifier id'>hash</span><span class='lbrack token'>[</span><span class='symbol val'>:pilot_groups_to_use</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_pilot_groups_to_use identifier id'>pilot_groups_to_use</span> <span class='rubyid_hash identifier id'>hash</span><span class='lbrack token'>[</span><span class='symbol val'>:release_groups_to_use</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_release_groups_to_use identifier id'>release_groups_to_use</span> <span class='rubyid_hash identifier id'>hash</span><span class='dot token'>.</span><span class='rubyid_sort identifier id'>sort</span><span class='dot token'>.</span><span class='rubyid_to_h identifier id'>to_h</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="unlock-instance_method"> #<strong>unlock</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("unlock-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:unlock">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Unlock this version for updates</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 1094 1095 1096 1097 1098 1099 1100</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 1094</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_unlock identifier id'>unlock</span> <span class='rubyid_curr_lock identifier id'>curr_lock</span> <span class='assign token'>=</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='dot token'>.</span><span class='rubyid_object_locks identifier id'>object_locks</span><span class='dot token'>.</span><span class='rubyid_dig identifier id'>dig</span> <span class='rubyid_title identifier id'>title</span><span class='comma token'>,</span> <span class='symbol val'>:versions</span><span class='comma token'>,</span> <span class='rubyid_version identifier id'>version</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_curr_lock identifier id'>curr_lock</span> <span class='rubyid_Xolo constant id'>Xolo</span><span class='colon2 op'>::</span><span class='rubyid_Server constant id'>Server</span><span class='dot token'>.</span><span class='rubyid_object_locks identifier id'>object_locks</span><span class='lbrack token'>[</span><span class='rubyid_title identifier id'>title</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='symbol val'>:versions</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='rubyid_delete identifier id'>delete</span> <span class='rubyid_version identifier id'>version</span> <span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Unlocked version '#{version}' of title '#{title}' for updates"</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="update-instance_method"> #<strong>update</strong>(new_data) ⇒ <tt>void</tt> </h3><script> document.getElementById("update-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:update">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>Update a this version, updating to the local filesystem, Jamf Pro, and the Title Editor as needed</p> </div> </div> <div class="tags"> <p class="tag_title">Parameters:</p> <ul class="param"> <li> <span class='name'>new_data</span> <span class='type'>(<tt>Hash</tt>)</span> — <div class='inline'><p>The new data sent from xadm</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 787</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_update identifier id'>update</span><span class='lparen token'>(</span><span class='rubyid_new_data identifier id'>new_data</span><span class='rparen token'>)</span> <span class='rubyid_lock identifier id'>lock</span> <span class='rubyid_@current_action ivar id'>@current_action</span> <span class='assign token'>=</span> <span class='symbol val'>:updating</span> <span class='rubyid_@new_data_for_update ivar id'>@new_data_for_update</span> <span class='assign token'>=</span> <span class='rubyid_new_data identifier id'>new_data</span> <span class='rubyid_@changes_for_update ivar id'>@changes_for_update</span> <span class='assign token'>=</span> <span class='rubyid_note_changes_for_update_and_log identifier id'>note_changes_for_update_and_log</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_@changes_for_update ivar id'>@changes_for_update</span><span class='dot token'>.</span><span class='rubyid_pix_empty? fid id'>pix_empty?</span> <span class='rubyid_progress identifier id'>progress</span> <span class='string val'>'No changes to make'</span><span class='comma token'>,</span> <span class='label val'>log:</span> <span class='symbol val'>:info</span> <span class='rubyid_return return kw'>return</span> <span class='rubyid_end end kw'>end</span> <span class='rubyid_log_info identifier id'>log_info</span> <span class='dstring node'>"Updating version '#{version}' of title '#{title}' for admin '#{admin}'"</span> <span class='comment val'># changelog - log the changes now, and</span> <span class='comment val'># if there is an error, we'll log that too</span> <span class='comment val'># saying the above changes were not completed and to</span> <span class='comment val'># look at the server log for details.</span> <span class='rubyid_log_update_changes identifier id'>log_update_changes</span> <span class='comment val'># update ted before jamf</span> <span class='rubyid_update_patch_in_ted identifier id'>update_patch_in_ted</span> <span class='rubyid_update_version_in_jamf identifier id'>update_version_in_jamf</span> <span class='rubyid_update_local_instance_values identifier id'>update_local_instance_values</span> <span class='rubyid_save_local_data identifier id'>save_local_data</span> <span class='rubyid_server_app_instance identifier id'>server_app_instance</span><span class='dot token'>.</span><span class='rubyid_update_client_data identifier id'>update_client_data</span> <span class='comment val'># new pkg uploads happen in a separate process</span> <span class='rubyid_rescue rescue kw'>rescue</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='rubyid_e identifier id'>e</span> <span class='rubyid_log_change identifier id'>log_change</span> <span class='label val'>msg:</span> <span class='dstring node'>"ERROR: The update failed and the changes didn't all go through!\n#{e.class}: #{e.message}\nSee server log for details."</span> <span class='comment val'># re-raise for proper error handling in the server app</span> <span class='rubyid_raise identifier id'>raise</span> <span class='rubyid_ensure ensure kw'>ensure</span> <span class='rubyid_unlock identifier id'>unlock</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="update_local_instance_values-instance_method"> #<strong>update_local_instance_values</strong> ⇒ <tt>void</tt> </h3><script> document.getElementById("update_local_instance_values-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:update_local_instance_values">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p class="note returns_void">This method returns an undefined value.</p><p>Update our instance attributes with any new data before saving the changes back out to the file system</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 988</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_update_local_instance_values identifier id'>update_local_instance_values</span> <span class='comment val'># update instance data with new data before writing out to the filesystem.</span> <span class='comment val'># Do this last so that the instance values can be compared to</span> <span class='comment val'># new_data_for_update in the steps above.</span> <span class='comment val'># Also, those steps might have updated some server-specific attributes</span> <span class='comment val'># which will be saved to the file system as well.</span> <span class='rubyid_ATTRIBUTES constant id'>ATTRIBUTES</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_attr identifier id'>attr</span><span class='comma token'>,</span> <span class='rubyid_deets identifier id'>deets</span><span class='bitor op'>|</span> <span class='comment val'># make sure these are updated elsewhere if needed,</span> <span class='comment val'># e.g. modification data.</span> <span class='rubyid_next next kw'>next</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_deets identifier id'>deets</span><span class='lbrack token'>[</span><span class='symbol val'>:read_only</span><span class='rbrack token'>]</span> <span class='rubyid_next next kw'>next</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_deets identifier id'>deets</span><span class='lbrack token'>[</span><span class='symbol val'>:cli</span><span class='rbrack token'>]</span> <span class='rubyid_new_val identifier id'>new_val</span> <span class='assign token'>=</span> <span class='rubyid_new_data_for_update identifier id'>new_data_for_update</span><span class='lbrack token'>[</span><span class='rubyid_attr identifier id'>attr</span><span class='rbrack token'>]</span> <span class='rubyid_old_val identifier id'>old_val</span> <span class='assign token'>=</span> <span class='rubyid_send identifier id'>send</span><span class='lparen token'>(</span><span class='rubyid_attr identifier id'>attr</span><span class='rparen token'>)</span> <span class='rubyid_next next kw'>next</span> <span class='rubyid_if if_mod kw'>if</span> <span class='rubyid_new_val identifier id'>new_val</span> <span class='eq op'>==</span> <span class='rubyid_old_val identifier id'>old_val</span> <span class='rubyid_log_debug identifier id'>log_debug</span> <span class='dstring node'>"Updating Xolo Version attribute '#{attr}': '#{old_val}' -> '#{new_val}'"</span> <span class='rubyid_send identifier id'>send</span> <span class='dstring node'>"#{attr}="</span><span class='comma token'>,</span> <span class='rubyid_new_val identifier id'>new_val</span> <span class='rubyid_end end kw'>end</span> <span class='comment val'># update any other server-specific attributes here...</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="updating?-instance_method"> #<strong>updating?</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("updating?-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/xolo-server/2.3.0/Xolo%2FServer%2FVersion:updating%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns Are we updating this version?.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> — <div class='inline'><p>Are we updating this version?</p></div> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 481 482 483</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xolo/server/version.rb', line 481</span> <span class='rubyid_def def kw'>def</span> <span class='rubyid_updating? fid id'>updating?</span> <span class='rubyid_current_action identifier id'>current_action</span> <span class='eq op'>==</span> <span class='symbol val'>:updating</span> <span class='rubyid_end end kw'>end</span> </pre> </td> </tr> </table> </div> </div> </div> <div id="footer"> Generated on Fri Sep 18 13:45:07 2026 by <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.9.45 (ruby-4.0.7). </div> </div> </body> </html>