#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
Solaris-specific customizations for Horizon
"""
('solaris', 'Solaris Non-Global Zone'))
# Bootargs feature:
# Add bootargs feature to 'SetAdvanced' workflow action.
"subsequent boot."))
try:
except Exception:
'information.'))
# Bootargs feature:
# If locally configured to do so add bootargs metadata vars
'boot_options', 'bootargs_persist',
)
# Remove 'PostCreationStep', 'SetAdvanced' from
)
# Bootargs feature:
# if locally configured to do so add back 'SetAdvanced'
)
# Bootargs feature:
# Add bootargs feature to 'UpdateInstance' workflow action class.
"subsequent boot."))
if data is None:
return True
if metadata['bootargs']:
else:
try:
data['instance_id'],
except Exception:
return False
return True
# Bootargs feature:
# Add bootargs To the action class for UpdateInstance
# Bootargs feature:
# if locally configured to do so add UpdateInstanceBootarg
)
# Remove 'TogglePause', 'MigrateInstance' actions from
# Set the available states for Create Snapshot to only be 'ACTIVE'
# Disable 'disk_over_commit', 'block_migration' in
# unchecked by default.
# Solaris brand type feature.
# Override CreateFlavorInfoAction adding Solaris Zone Brand drop down
# if SOLARIS_BRANDTYPE is set to True
"cores, and other resources and can be selected when "
"users deploy instances.")
# Solaris brand type feature.
# Override UpdateFlavorInfoAction adding Solaris Zone Brand drop down
# if SOLARIS_BRANDTYPE is set to True
"RAM, disk, number of cores, and other resources. "
"Flavors are selected when users deploy instances.")
# Solaris brand type feature.
# Override CreateFlavor ensuring brand type metadata is saved to flavor
is_public = not flavor_access
# Create the flavor
try:
except Exception:
return False
# Update flavor access if the new flavor is not public
for project in flavor_access:
try:
except Exception:
_('Unable to set flavor access for project %s.') % project)
return True
# Solaris brand type feature.
# Override UpdateFlavor ensuring brand type metadata is saved to flavor
is_public = not flavor_projects
# Update flavor information
try:
# Grab any existing extra specs, because flavor edit is currently
# implemented as a delete followed by a create.
# Mark the existing flavor as deleted.
# Then create a new flavor with the same name but a new ID.
# because if the delete fails the API will error out because
# active flavors can't have the same name.
data['name'],
data['memory_mb'],
data['vcpus'],
data['disk_gb'],
if (extras_dict):
except Exception:
return False
# Add flavor access if the flavor is not public.
for project in flavor_projects:
try:
except Exception:
'but unable to modify flavor '
'access.'))
return True
# Solaris brand type feature.
# Override UpdateView ensuring brand type metadata is retrieved from flavor
try:
# Get initial flavor information
except Exception:
_('Unable to retrieve flavor details.'),
else:
'zone_brand': zone_brand}
# Solaris brand type feature.
# Various overrides only peformed if SOLARIS_BRANDTYPE is set to True
'openstack_dashboard.dashboards.admin.flavors.views',
name='update'),
)