plandesc.py revision 2828
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] 2690N/A# Copyright (c) 2012, 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.""" 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 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.""" 2690N/A out +=
" implementation: %s (%s default) " \
2690N/A out +=
" implementation: %s (%s 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 2690N/A """Returns a tuple of two lists containing the facet and variant 2690N/A """Returns a formatted list of strings representing the 2690N/A """A generation 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 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 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"""