2875N/A# The contents of this file are subject to the terms of the 2875N/A# Common Development and Distribution License (the "License"). 2875N/A# You may not use this file except in compliance with the License. 2875N/A# See the License for the specific language governing permissions 2875N/A# and limitations under the License. 2875N/A# When distributing Covered Code, include this CDDL HEADER in each 2875N/A# If applicable, add the following below this CDDL HEADER, with the 2875N/A# fields enclosed by brackets "[]" replaced with your own identifying 2875N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3336N/A# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. 2875N/A# List of available options for common option processing. 3185N/A """"Parse set property options that were specified on the command 3185N/A line into a dictionary. Make sure duplicate properties were not 3185N/A "must be of the form '<name>=<value>'. This is " 3185N/A "be set once in a command. {0} was set twice" 3185N/A """"Parse add or remove property values options that were specified 3185N/A on the command line into a dictionary. Make sure duplicate properties 3185N/A "{add} must be of the form '<name>=<value>'. " 3371N/A # Allow wildcard to support an easy, scriptable 3371N/A # way of enabling all existing entries. 3185N/A # Allow wildcard to support an easy, scriptable 3185N/A # way of removing all existing entries. 3185N/A # Allow wildcard to support an easy, scriptable 3185N/A # way of removing all existing entries. 2875N/A # synthesize require_new_be and deny_new_be into new_be 2875N/A # create a new key called BACKUP_BE in the options array 2875N/A # synthesize require_backup_be and no_backup_be into backup_be 2875N/A # create a new key called BACKUP_BE in the options array 2875N/A # synthesize li_ignore_all and li_ignore_list into li_ignore 2875N/A # check if there's nothing to ignore 2875N/A # can't ignore all and specific images 2875N/A # can't ignore all and target anything. 2875N/A # it doesn't make sense to specify images to ignore if the 2875N/A # user is already specifying images to operate on. 2875N/A # if a target child linked image was specified, the no-parent-sync 2875N/A # option doesn't make sense since we know that both the parent and 2875N/A # child image are accessible 2875N/A # we don't accept linked image target options 3336N/A # Check whether unpackaged and unpackaged_only options are used 3407N/A # Check whether path options is used with either unpackaged 3407N/A # or unpackaged_only options. 2875N/A """"Parse linked image property options that were specified on the 2875N/A command line into a dictionary. Make sure duplicate properties were 2875N/A "property arguments must be of the form " 3158N/A "property specified multiple times: " 2875N/A """convert linked image prop list into a dictionary""" 2875N/A # figure out which option the user specified 2875N/A # validate linked image name 2875N/A # figure out which option the user specified 3025N/A # Go through all children and check if they are in the recurse list. 3158N/A _(
"invalid linked image or zone name " 3025N/A # If we use image recursion we need to make sure uninstall and update 3025N/A # ignore non-existing packages in the parent image. 2875N/A # check if we accept the -q option 2875N/A # Be careful not to overwrite global_settings.client_output_quiet 2875N/A # because it might be set "True" from elsewhere, e.g. in 2875N/A # if we're attaching a new child then that doesn't affect 2875N/A # any other children, so ignoring them doesn't make sense. 2875N/A # if the user didn't specify linked-md-only we're done 2875N/A # li_md_only implies no li_pkg_updates 2875N/A # if li_md_only is false that means we're not updating any packages 2875N/A # within the current image so there are a ton of options that no 2875N/A # longer apply to the current operation, and hence are incompatible 2875N/A # Use of -g implies -a unless -n is provided. 2875N/A # get the original argument value 2875N/A # make sure it is an integer 2875N/A # update the new options array to make the value an integer 2875N/A # not a valid file descriptor 2875N/A # remove concurrency from parameters dict 2875N/A # make sure we have an integer 2875N/A # update global concurrency setting 2875N/A # remove concurrency from parameters dict 3014N/A # make sure we have an integer 3014N/A # 0 is no sync actuators are used (timeout=0) 2875N/A# options common to multiple pkg(1) operations. The format for specifying 2875N/A# options is a list which can contain: 2875N/A# k: the key value for the options dictionary 3031N/A# val: the valid argument list. It should be a list, 3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3371N/A "items": {
"type":
"string"}
3371N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}}),
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
3185N/A "items": {
"type":
"string"}
2875N/A# Options for pkg(1) subcommands. Built by combining the option tables above, 2875N/A# with some optional subcommand unique options defined below. 3014N/A# "update" cmd inherits all main cmd options 3014N/A# "attach-linked" cmd inherits all main cmd options 3014N/A# "set-property-linked" cmd inherits all main cmd options 3014N/A# "sync-linked" cmd inherits all main cmd options 3407N/A "items": {
"type":
"string"}}),
2875N/A """Get the available options for a particular operation specified by 2875N/A 'op'. If the client uses custom pkg_op_opts tables they can be specified 2875N/A """ Get the default value for a certain option 'opt' of a certain 2875N/A operation 'op'. This is useful for clients which toggle boolean options. 2875N/A """Assembly of the options for a specific operation. Options are read in 2875N/A from a dict (see explanation below) and sanity tested. 2875N/A This is the common interface to supply options to the functions of the 2875N/A 'op' is the operation for which the options need to be assembled and 2875N/A verified. The currently supported operations are listed in 2875N/A 'api_inst' is a reference to the API instance, required for some of the 2875N/A 'opts' is the raw options table to be processed. It needs to be a dict 2875N/A in the format: { option_name: argument, ... } 3031N/A # If no valid argument list specified. 2875N/A # for options not given we substitue the default value 3336N/A # If the any of valid_args is integer, we first 3336N/A # try to convert the argument value into 3336N/A # integer. This is for CLI mode where arguments 2875N/A # run the option verification callbacks