Lines Matching defs:image

28 Linked image module classes.
35 The following template classes which linked image plugins should inherit from
78 # linked image relationship types (returned by LinkedImage.list_related())
83 # linked image properties
110 # special linked image name values (PROP_NAME)
113 # linked image model values (PROP_MODEL)
121 # files which contain linked image data
137 """Sanity check a linked image operation return value tuple.
141 json dictionary containing planned image changes
165 """Given a linked image return value dictionary, sanity check all the
178 """Given a linked image return value dictionary, return a list of any
209 """This class is a template that all linked image plugins should
210 inherit from. Linked image plugins derived from this class are
211 designed to manage linked aspects of the current image (vs managing
212 linked aspects of a specific child of the current image).
215 private to the linked image subsystem and should not be called
224 """Initialize a linked image plugin.
235 """Called when the path to the image that we're operating on
236 is changing. This normally occurs when we clone an image
243 """If the linked image plugin is able to detect that we're
244 operating on an image in an alternate root then return an
246 image path and the current one."""
253 the current image. The paths that are returned should be
254 absolute paths to the original child image locations."""
260 """Get the linked image properties associated with the
261 specified child image."""
267 """Attach the specified child image. This operation should
268 only affect in-memory state of the current image. It should
269 not update any persistent on-disk linked image state or access
270 the child image in any way. This routine should assume that
271 the linked image properties have already been validated."""
277 """Detach the specified child image. This operation should
278 only affect in-memory state of the current image. It should
279 not update any persistent on-disk linked image state or access
280 the child image in any way."""
286 """Sync out the in-memory linked image state of this image to
294 """This class is a template that all linked image child plugins should
295 inherit from. Linked image child plugins derived from this class are
296 designed to manage linked aspects of children of the current image.
297 (vs managing linked aspects of the current image itself).
300 private to the linked image subsystem and should not be called
304 """Initialize a linked image child plugin.
312 """Called before a parent image saves linked image properties
313 into a child image. Gives the linked image child plugin a
315 child image."""
322 """A class for naming child linked images. Linked image names are
325 image and a linked image name. Linked image names have the following
409 """A LinkedImage object is used to manage the linked image aspects of
410 an image. This image could be a child image, a parent image, or both
411 a parent and child. This object allows for access to linked image
415 # Properties that a parent image with push children should save locally.
420 # Properties that a pull child image should save locally.
428 # Properties that a parent image with push children should save in
471 # initialize linked image plugin objects
477 # if the image has a path setup, we can load data from it.
482 def image(self):
483 """Get a pointer to the image object associated with this
484 linked image object."""
489 image.py`__set_root() to let us know when we're changing the
490 root location of the image. (The only time we change the root
500 # Check if this is our first time accessing the current image
504 # figure out the new root image path
507 # initialize paths for linked image data files
515 # if this isn't a reset, then load data from the image
537 # Tell linked image plugins about the updated paths
543 # Tell linked image children about the updated paths
549 linked image properties. This routine sanity check the
577 image properties. Don't update any state."""
581 # if we're not a child image ourselves, then we're done
590 # validate the linked image name
662 """Given a set of linked image properties, the image paths
663 stored within those properties may not match the actual image
666 properties that represent the current path to the image, and a
678 """If we're initializing parent linked image properties for
680 then we need to know if the parent image that we're currently
682 do this is to ask our linked image plugins if they can
683 determine this (the zones linked image plugin usually can
684 if the image is a global zone)."""
715 parent image."""
717 # ask our plugins if we're operating with alternate image paths
727 """Load linked image properties from disk and return them to
729 update any internal linked image state.
732 linked image metadata files, or if we should access temporary
739 # read the linked image properties from disk
752 # convert PROP_NAME into a linked image name obj
766 """Load linked image inherited facets from disk.
770 linked image metadata files, or if we should access temporary
793 """Load linked image parent packages from disk.
797 linked image metadata files, or if we should access temporary
818 """Load linked image parent publishers from disk.
822 linked image metadata files, or if we should access temporary
837 """Load linked image properties and constraints from disk.
838 Update the linked image internal state with the loaded data."""
841 # Normally, if we're a parent image we'll have linked image
844 # If no properties are loaded, we may still be a parent image
851 # image metadata, and we're having runtime errors querying for
864 # Oops. We're a parent image with no properties
894 # it's better than failing and preventing any image updates.
907 """Validate user supplied linked image attach properties.
939 # is this property valid for this type of image?
952 parent image."""
970 """If our in-memory linked image state matches the on-disk
971 linked image state then there's nothing to do. If the state
975 # check if we're not a linked image.
977 # if any linked image metadata files exist they need
999 # linked image metadata files with inherited data
1006 # check if we're just a parent image.
1009 # image metadata files that contain inherited
1039 """If we're a child image's, verify that the parent image
1042 configured within the parent image must also be configured
1043 within the child image with the same:
1048 The child image may have additional publishers configured but
1052 # if we're not a child image then bail
1068 # child image needs at least as many publishers as the parent
1081 """Update linked image constraint, publisher data, and
1082 state from our parent image."""
1085 # we're not a child image, nothing to do
1092 # initialize the parent image
1097 # get metadata from our parent image
1103 """Update linked image constraint, publisher data, and state
1104 from our parent image. If catch_exception is true catch any
1105 linked image exceptions and pack them up in a linked image
1117 """Write in-memory linked image state to disk."""
1157 """If the current image is a child image, this function
1158 returns a linked image name object which represents the name
1159 of the current image."""
1166 """Indicates whether the current image is a child image."""
1171 """Indicates whether the current image is a parent image.
1174 trying to determine if we're a parent image.
1181 """Indicates whether the current image is a parent image."""
1186 """Indicates wether the current image is already linked."""
1196 """Check if we're accessing a linked image at an alternate
1202 """Report our current image path."""
1208 """Report our current image path."""
1225 """Return a dictionary which represents the linked image
1226 properties associated with a linked image.
1228 'lin' is the name of the child image. If lin is None then
1229 the current image is assumed to be a linked image and it's
1253 """Raise an exception because the current image is not a child
1254 image."""
1259 """Check if a specific child image exists."""
1273 """Given a list of linked image name objects, make sure all
1284 """Facets inherited from our parent image."""
1288 """A set of the fmris installed in our parent image."""
1293 # image.
1299 """Given a string representing a linked image child name,
1300 returns linked image name object representing the same name.
1314 current image.
1334 # sort by linked image name
1359 current image. This includes both child and parent images.
1394 # sort by linked image name
1402 disk, to sync linked image state to disk call syncmd."""
1424 # we don't bother to cleanup the path to the parent image here
1426 # image, it will do that work for us.
1429 # get the cleaned up parent image path.
1432 # Make sure our parent image is at it's default path. (We
1433 # don't allow attaching new images if an image is located at
1472 disk, to sync linked image state to disk call syncmd."""
1485 # Generate a new set of linked image properties. If we have
1495 # Update our linked image properties.
1499 """Determine if an image is in sync with its constraints."""
1543 """If the current image is a child image, this function
1544 audits the current image to see if it's in sync with its
1552 # we don't use the latest linked image metadata.
1554 # computed using the initial linked image metadata
1575 rv = self.image.linked.audit_self(latest_md=latest_md)[0]
1672 """Sanity check the parameters associated with a child image
1696 # path must be an image
1705 # Does the parent image (ourselves) reside in clonable BE?
1711 # If the parent image is clonable then the new child image
1719 # Child image should not already be linked
1736 image. This is done by looking at all the parent directories
1737 for both the parent and the child image until we reach a
1748 # The parent image can't be nested nested within child.
1753 # Make sure we're not linking the root image as a child.
1758 # Make sure our current image is at it's default path. (We
1759 # don't allow attaching new images if an image is located at
1767 image."""
1779 # child image.
1814 """Attach an image as a child to the current image (the
1815 current image will become a parent image. This operation
1816 results in attempting to sync the child image with the parent
1817 image.
1851 # if the current image isn't linked yet then we need to
1852 # generate some linked image properties for ourselves
1915 # commit child image property updates
1921 # save parent image properties
1925 # since we always update our own image metadata, we always
1932 """Audit one or more children of the current image to see if
1933 they are in sync with this image."""
1953 """Sync one or more children of the current image."""
1988 """Detach one or more children from the current image. This
2006 # we can't detach this type of image.
2039 # commit child image property updates
2063 '_lic_list' is a list of linked image child objects to perform
2067 always recurse into a child even if the linked image meta data
2089 """An iterator function which performs a linked image
2098 '_rvdict' is a dictionary, indexed by linked image name, which
2111 operation to generate an image plan.
2114 linked image metadata in a temporary location in child images,
2155 # If we have a plan for the current image that means linked
2156 # image metadata is probably changing so we always save it to
2249 # syncmd during setup we discover the linked image metadata
2287 # poll on all the linked image children and see which
2356 """Initialize planning state. If we're a child image we save
2400 image children to perform the specified operation.
2403 # get a pointer to the current image plan
2442 # image plan onto the child and also expect an image plan from
2500 # image, figure out what api operation should be performed on
2504 # an pkg update in the parent image without any packages
2514 # so if its linked image metadata isn't changing then the child
2562 # the current image the api client will also have to
2564 # that happens we'll just assume that the parent image license
2565 # space is a superset of the child image license space (and
2611 """Plan child image updates."""
2650 """Prepare child image updates."""
2655 """Execute child image updates."""
2672 # make a copy of the linked image properties
2679 # load linked image state from the plan
2706 image."""
2716 """A LinkedImageChild object is used when a parent image wants to
2717 access a child image. These accesses may include things like:
2718 saving/pushing linked image metadata into a child image, syncing or
2719 auditing a child image, or recursing into a child image to keep it in
2720 sync with planned changes in the parent image."""
2730 self.__img = li.image
2746 # initialize paths for linked image data files
2752 # initialize a linked image child plugin
2762 """Get the name associated with a child image."""
2767 """Get the path associated with a child image."""
2775 """Get a pointer to the parent image object associated with
2780 """Write data to a child image."""
2833 """Sync linked image parent constraint data to a child image.
2836 linked image metadata files, or if we should access temporary
2844 """Sync linked image parent facet data to a child image.
2847 linked image metadata files, or if we should access temporary
2856 """Sync linked image properties data to a child image.
2859 linked image metadata files, or if we should access temporary
2874 """Sync linked image parent publisher data to a child image.
2877 linked image metadata files, or if we should access temporary
2884 """Sync linked image data to a child image.
2887 linked image metadata files, or if we should access temporary
2903 """Prepare to perform an operation on a child image by syncing
2904 the latest linked image data to that image. As part of this
2909 sync to the child image. Note this is not all the metadata
2914 always recurse into a child even if the linked image meta data
2918 image meta data into temporary files (instead of overwriting
2922 image meta data, instead we should just test to see if the
2926 performing on a child image."""
2964 """Prepare to sync a child image. This involves updating the
2965 linked image metadata in the child and then possibly recursing
2973 # we're not going to recurse into the child image,
3036 """Prepare to update a child image."""
3080 """Prepare to install a pkg in a child image."""
3116 """Prepare to install a pkg in a child image."""
3149 """Prepare to install a pkg in a child image."""
3197 """Prepare to detach a child image."""
3219 # setup recursion into the child image
3224 """Prepare to a child image to see if it's in sync with its
3232 # setup recursion into the child image
3242 """Public interface to abort an operation on a child image."""
3251 perform on a child image."""
3286 """Public interface to start an operation on a child image."""
3295 """Public interface to query if an operation on a child image
3307 child image.
3372 p_dict["image-name"] = str(self.child_name)
3378 instance that is operating on a child image."""
3382 """Our image path is being updated, so figure out our new
3383 child image paths. This interface only gets invoked when:
3385 - We're doing a packaging operation on a parent image and
3391 - We tried to update a cloned image (as described above) and
3408 # Interfaces to obtain linked image metadata from an image
3411 """Return publisher information for the specified image.
3434 # if there's an image plan the we need to update the installed
3451 """Get Facets from an image that a child should inherit.
3471 # installed catalog. If this is a non-image modifying operation then
3472 # the installed catalog should be sufficient. If this is an image
3475 # and used during the image planning operation) to lookup information
3484 # dependency actions and find those that are affected by image facets.
3498 # check if any image facets affect this dependency
3522 # which are installed (or planned) within the parent image. This
3527 # installed (or planned) in the parent image, we don't bother
3543 # its parent image.
3569 # and the following image facets:
3591 """Save JSON encoded linked image metadata to a file."""
3620 """Load JSON encoded linked image metadata from a file."""
3645 """Utility class used when json encoding linked image metadata."""
3668 """Utility class used when json decoding linked image metadata."""
3704 indicate bugs (or possibly corrupted linked image metadata), so they
3717 err = "Invalid linked image update policy: {0}".format(bad_iup)
3720 err = "Invalid linked image type: {0}".format(bad_lin_type)
3744 path = li.image.root
3750 err_prefix = "Linked image error: "
3752 err_prefix = "Linked image ({0}) error: ".format(str(lin))
3756 err_suffix = "\nLinked image ({0}) path: {1}".format(str(lin),
3759 err_suffix = "\nLinked image path: {0}".format(path)