2690N/A# The contents of this file are subject to the terms of the 2690N/A# Common Development and Distribution License (the "License"). 2690N/A# You may not use this file except in compliance with the License. 2690N/A# See the License for the specific language governing permissions 2690N/A# and limitations under the License. 2690N/A# When distributing Covered Code, include this CDDL HEADER in each 2690N/A# If applicable, add the following below this CDDL HEADER, with the 2690N/A# fields enclosed by brackets "[]" replaced with your own identifying 2690N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3336N/A# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. 2690N/APlanDescription and _ActionPlan classes 2690N/AThese classes are part of the public API, and any changes here may require 2690N/Abumping CURRENT_API_VERSION in pkg.api 2690N/AThe PlanDescription class is a public interface which contains all the data 2690N/Aassociated with an image-modifying operation. 2690N/AThe _ActionPlan class is a private interface used to keep track of actions 2690N/Amodified within an image during an image-modifying operation. 2690N/A """A named tuple used to keep track of all the actions that will be 2690N/A executed during an image-modifying procecure.""" 2828N/A # Class has no __init__ method; pylint: disable=W0232 2828N/A # Use __slots__ on an old style class; pylint: disable=E1001 2690N/A """Returns the serialized state of this object in a format 2690N/A that that can be easily stored using JSON, pickle, etc.""" 2690N/A """Allocate a new object using previously serialized state 2690N/A obtained via getstate().""" 2828N/A # Access to protected member; pylint: disable=W0212 2690N/A # get the name of the object we're dealing with 2690N/A # decode serialized state into python objects 2690N/A """A class which describes the changes the plan will make.""" 3366N/A # avoid, implicit-avoid, obsolete 3336N/A # {"item_id": {"sub_item_id": [], "messages": []}} 2690N/A # Properties set when state >= EVALUATED_PKGS 2690N/A # update (oldfmri, newfmri|oldfmri) 2690N/A # Properties set when state >= EVALUATED_OK 2690N/A # smf and other actuators (driver actions get added during 2690N/A # Used to track users and groups that are part of operation. 2708N/A # release notes that are part of this operation 2690N/A # Properties set when state >= EXECUTED_OK 2690N/A # Set by imageplan.set_be_options() 2690N/A # Accessed via imageplan.update_index 2690N/A # stats about the current image 2690N/A """Returns the serialized state of this object in a format 2690N/A that that can be easily stored using JSON, pickle, etc.""" 2828N/A # Access to protected member; pylint: disable=W0212 2690N/A # backup and clear volatiles 2690N/A # add a state version encoding identifier 2690N/A """Update the state of this object using previously serialized 2690N/A state obtained via getstate().""" 2828N/A # Access to protected member; pylint: disable=W0212 2690N/A # get the name of the object we're dealing with 2690N/A # version check and delete the encoding identifier 2690N/A # decode serialized state into python objects 2690N/A """Allocate a new object using previously serialized state 2690N/A obtained via getstate().""" 2690N/A """Save a json encoded representation of this plan 2690N/A description objects into the specified file object.""" 2828N/A # Access to protected member; pylint: disable=W0212 2690N/A """Load a json encoded representation of a plan description 2690N/A from the specified file object.""" 2828N/A # Access to protected member; pylint: disable=W0212 2690N/A """A private interface used after a plan is successfully 2690N/A invoked to free up memory.""" 2690N/A # reduce memory consumption 3014N/A # We have to save the timed_out state. 2690N/A """A boolean indicating if we attempted to execute this 2690N/A """Returns a list of string tuples describing affected services 2690N/A """Returns a list of three-tuples containing information about 2690N/A the mediators. The first element in the tuple is the name of 2690N/A the mediator. The second element is a tuple containing the 2690N/A original version and source and the new version and source of 2690N/A the mediator. The third element is a tuple containing the 2690N/A original implementation and source and new implementation and 2828N/A # Missing docstring; pylint: disable=C0111 2690N/A """Returns list of strings describing mediator changes.""" 3158N/A out +=
" implementation: {0} ({1} default)" \
3158N/A out +=
" implementation: {0} ({1} default)" \
2690N/A """Get the proposed fmri changes.""" 2690N/A """A list of tuples of items that were salvaged during plan 2690N/A execution. Each tuple is of the form (original_path, 2690N/A salvage_path). Where 'original_path' is the path of the item 2690N/A before it was salvaged, and 'salvage_path' is where the item was 2690N/A moved to. This property is only valid after plan execution 2925N/A """Returns a tuple of two lists containing the facet and 2925N/A variant changes in this plan. 2925N/A The variant list contains tuples with the following format: 2925N/A The facet list contains tuples with the following format: 2925N/A (<facet>, <new-value>, <old-value>, <source>, 2925N/A <new-masked>, <old-masked>) 2925N/A # sort results by variant name 2925N/A # create new dictionaries that index facets by name and 2925N/A # dict[(<facet, src>)] = (<value>, <masked>) 3455N/A # not-an-iterable self._old_facets; 2925N/A # W0212 Access to a protected member 3455N/A # not-an-iterable self._new_facets; 2925N/A # W0212 Access to a protected member 2925N/A # check for changing facets 2925N/A # sort results by facet name 2690N/A """Returns a formatted list of strings representing the 3047N/A """A generator function that yields tuples of PackageInfo 2690N/A objects of the form (src_pi, dest_pi). 2690N/A If 'src_pi' is None, then 'dest_pi' is the package being 2690N/A If 'src_pi' is not None, and 'dest_pi' is None, 'src_pi' 2690N/A is the package being removed. 2690N/A If 'src_pi' is not None, and 'dest_pi' is not None, 2690N/A then 'src_pi' is the original version of the package, 2690N/A and 'dest_pi' is the new version of the package it is 3047N/A """This function returns a tuple of generators that yield tuples 3047N/A of the form (src, dest) of the preserved ("editable") files that 3047N/A will be installed, moved, removed, or updated. The returned 3047N/A list of generators is (moved, removed, installed, updated).""" 2690N/A """A generator function that yields action change descriptions 2690N/A in the order they will be performed.""" 2828N/A # Unused variable '%s'; pylint: disable=W0612 2708N/A """True if there are release notes for this plan""" 2708N/A """True if the release notes must be displayed""" 2708N/A """A generator that returns the release notes for this plan""" 2690N/A """A generator function that yields information about the 2690N/A licenses related to the current plan in tuples of the form 2690N/A (dest_fmri, src, dest, accepted, displayed) for the given 2690N/A package FMRI or all packages in the plan. This is only 2690N/A available for licenses that are being installed or updated. 2690N/A 'dest_fmri' is the FMRI of the package being installed. 2690N/A 'src' is a LicenseInfo object if the license of the related 2690N/A package is being updated; otherwise it is None. 2690N/A 'dest' is the LicenseInfo object for the license that is being 2690N/A 'accepted' is a boolean value indicating that the license has 2690N/A been marked as accepted for the current plan. 2690N/A 'displayed' is a boolean value indicating that the license has 2690N/A been marked as displayed for the current plan.""" 2828N/A # Unused variable; pylint: disable=W0612 2690N/A """Returns a list of strings for all FMRIs evaluated by the 2690N/A solver explaining why they were rejected. (All packages 2690N/A found in solver's trim database.) Only available if 2690N/A DebugValues["plan"] was set when the plan was created. 2690N/A # in case this operation doesn't use solver 3336N/A """Display the parsable version of the plan.""" 3336N/A # Lists of lists are used here becuase 3336N/A # json will convert lists of tuples 3336N/A # into lists of lists anyway. 3336N/A # Lists of lists are used here to ensure a consistent 3336N/A # ordering and because tuples will be converted to 3336N/A # lists anyway; a dictionary would be more logical for 3336N/A # the top level entries, but would make testing more 3336N/A # difficult and this is a small, known set anyway. 3336N/A # If api_inst is set, mark licenses as 3336N/A # The image name for the parent image is always None. If this 3336N/A # image is a child image, then the image name will be set when 3336N/A # the parent image processes this dictionary. 3336N/A """Return parsable item messages.""" 3110N/A """Add a new message with its time, type and text for an 3336N/A # First level messaging looks like: 3336N/A # {"item_id": {"messages": [msg_payload ...]}} 3336N/A # Second level messaging looks like: 3336N/A # {"item_id": {"sub_item_id": [msg_payload ...]}}. 3110N/A """Add new messages to an item.""" 3336N/A """Convert a message dictionary to a list.""" 3452N/A """Generate ordered messages.""" 3452N/A # To make the first level messages come 3452N/A """Generate unordered messages.""" 3146N/A """Return all item messages. 3146N/A 'ordered' is an optional boolean value that indicates that 3253N/A item messages will be sorted by msg_time. If False, item 3452N/A messages will be in an arbitrary order. 3452N/A 'stages' is an optional list or set of the stages of messages 3014N/A """Set timeout for synchronous actuators.""" 3160N/A """Add a pkg actuator to the plan. The internal dictionary looks 3160N/A exec_op : [ changed pkg, ... ], 3160N/A """Pkg actuators which got triggered by operation.""" 3014N/A """Indicates that a synchronous actuator timed out.""" 2690N/A """Return the type of plan that was created (ex: 2690N/A """Boolean indicating if indexes will be updated as part of an 2690N/A image-modifying operation.""" 2690N/A """Either None, True, or False. If None then executing this 2690N/A plan may create a backup BE. If False, then executing this 2690N/A plan will not create a backup BE. If True, then executing 2690N/A this plan will create a backup BE.""" 2690N/A """The name of a new BE that will be created if this plan is 2690N/A """The name of a new backup BE that will be created if this 2690N/A """A boolean value indicating whether any new boot environment 2690N/A will be set active on next boot.""" 2690N/A """A boolean value indicating that execution of the plan will 2690N/A require a restart of the system to take effect if the target 2690N/A image is an existing boot environment.""" 2690N/A """A boolean value indicating that execution of the plan will 2690N/A take place in a clone of the current live environment""" 2690N/A """A boolean value indicating whether or not the boot archive 2690N/A """Estimated number of bytes added""" 2690N/A """Estimated number of download cache bytes added""" 2690N/A """Estimated number of bytes available in image /""" 2690N/A """Estimated number of bytes available in download cache""" 2925N/A """If facets are changing, this is the new set of facets being