Fix the string coding inconsistency between python2 and python3
Change-Id: I0e926e58f65834205da028549d3a38df55c07f5e Task: 24628 Story: 2003432
This commit is contained in:
parent
c069800adc
commit
9776a4d294
|
@ -23,14 +23,14 @@
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
project = u'stx-gui'
|
project = 'stx-gui'
|
||||||
copyright = u'2018, StarlingX'
|
copyright = '2018, StarlingX'
|
||||||
author = u'StarlingX'
|
author = 'StarlingX'
|
||||||
|
|
||||||
# The short X.Y version
|
# The short X.Y version
|
||||||
version = u''
|
version = ''
|
||||||
# The full version, including alpha/beta/rc tags
|
# The full version, including alpha/beta/rc tags
|
||||||
release = u'0.1'
|
release = '0.1'
|
||||||
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
# -- General configuration ---------------------------------------------------
|
||||||
|
@ -136,8 +136,8 @@ latex_elements = {
|
||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
(master_doc, 'stx-gui.tex', u'stx-gui Documentation',
|
(master_doc, 'stx-gui.tex', 'stx-gui Documentation',
|
||||||
u'StarlingX', 'manual'),
|
'StarlingX', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ latex_documents = [
|
||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
(master_doc, 'stx-gui', u'stx-gui Documentation',
|
(master_doc, 'stx-gui', 'stx-gui Documentation',
|
||||||
[author], 1)
|
[author], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ man_pages = [
|
||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
(master_doc, 'stx-gui', u'stx-gui Documentation',
|
(master_doc, 'stx-gui', 'stx-gui Documentation',
|
||||||
author, 'stx-gui', 'StarlingX Horizon plugins for new StarlingX services.',
|
author, 'stx-gui', 'StarlingX Horizon plugins for new StarlingX services.',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
|
@ -191,8 +191,8 @@ latex_elements = {
|
||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'stx-guireleasenotes.tex', u'stx-gui Release Notes',
|
('index', 'stx-guireleasenotes.tex', 'stx-gui Release Notes',
|
||||||
u'StarlingX', 'manual'),
|
'StarlingX', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
# The name of an image file (relative to this directory) to place at the top of
|
||||||
|
@ -221,8 +221,8 @@ latex_documents = [
|
||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('index', 'stx-guireleasenotes', u'stx-gui Release Notes',
|
('index', 'stx-guireleasenotes', 'stx-gui Release Notes',
|
||||||
[u'StarlingX'], 1)
|
['StarlingX'], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
# If true, show URL addresses after external links.
|
||||||
|
@ -235,8 +235,8 @@ man_pages = [
|
||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
('index', 'stx-guiReleaseNotes', u'stx-gui Release Notes',
|
('index', 'stx-guiReleaseNotes', 'stx-gui Release Notes',
|
||||||
u'StarlingX', 'stx-guireleasenotes',
|
'StarlingX', 'stx-guireleasenotes',
|
||||||
'StarlingX Horizon plugins for new StarlingX services',
|
'StarlingX Horizon plugins for new StarlingX services',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
]
|
]
|
||||||
|
|
|
@ -40,10 +40,10 @@ SUPPRESSION_STATUS_CHOICES = (
|
||||||
)
|
)
|
||||||
SUPPRESSION_STATUS_DISPLAY_CHOICES = (
|
SUPPRESSION_STATUS_DISPLAY_CHOICES = (
|
||||||
("suppressed", pgettext_lazy("Indicates this type of alarm \
|
("suppressed", pgettext_lazy("Indicates this type of alarm \
|
||||||
is suppressed", u"suppressed")),
|
is suppressed", "suppressed")),
|
||||||
("unsuppressed", pgettext_lazy("Indicates this type of alarm \
|
("unsuppressed", pgettext_lazy("Indicates this type of alarm \
|
||||||
is unsuppressed", u"unsuppressed")),
|
is unsuppressed", "unsuppressed")),
|
||||||
("None", pgettext_lazy("Indicates an event type", u"None")),
|
("None", pgettext_lazy("Indicates an event type", "None")),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -172,16 +172,16 @@ class SuppressEvent(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Suppress Event",
|
"Suppress Event",
|
||||||
u"Suppress Event",
|
"Suppress Event",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Events suppressed for Alarm ID",
|
"Events suppressed for Alarm ID",
|
||||||
u"Events suppressed for Alarm ID",
|
"Events suppressed for Alarm ID",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -212,16 +212,16 @@ class UnsuppressEvent(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Unsuppress Event",
|
"Unsuppress Event",
|
||||||
u"Unsuppress Event",
|
"Unsuppress Event",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Events unsuppressed for Alarm ID",
|
"Events unsuppressed for Alarm ID",
|
||||||
u"Events unsuppressed for Alarm ID",
|
"Events unsuppressed for Alarm ID",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class CpuFunctionsTable(tables.DataTable):
|
||||||
verbose_name=_('Processor Logical Cores'))
|
verbose_name=_('Processor Logical Cores'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.allocated_function)
|
return str(datum.allocated_function)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "cpufunctions"
|
name = "cpufunctions"
|
||||||
|
|
|
@ -58,7 +58,7 @@ class DevicesTable(tables.DataTable):
|
||||||
verbose_name=_('Enabled'))
|
verbose_name=_('Enabled'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.name
|
return datum.name
|
||||||
|
@ -85,7 +85,7 @@ class UsageTable(tables.DataTable):
|
||||||
verbose_name=_('VFs used'))
|
verbose_name=_('VFs used'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.id)
|
return str(datum.id)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.host
|
return datum.host
|
||||||
|
@ -132,7 +132,7 @@ class DeviceUsageTable(tables.DataTable):
|
||||||
verbose_name=_("VFs used"))
|
verbose_name=_("VFs used"))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.device_id)
|
return str(datum.device_id)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.device_name
|
return datum.device_name
|
||||||
|
|
|
@ -32,16 +32,16 @@ class DeleteAddress(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Address",
|
"Delete Address",
|
||||||
u"Delete Addresses",
|
"Delete Addresses",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Address",
|
"Deleted Address",
|
||||||
u"Deleted Addresses",
|
"Deleted Addresses",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ class AddressTable(tables.DataTable):
|
||||||
verbose_name=_("DAD"))
|
verbose_name=_("DAD"))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return ("%(address)s/%(prefix)s" %
|
return ("%(address)s/%(prefix)s" %
|
||||||
|
|
|
@ -549,7 +549,7 @@ class AddInterface(forms.SelfHandlingForm):
|
||||||
if not data['vlan_id'] or data['iftype'] != 'vlan':
|
if not data['vlan_id'] or data['iftype'] != 'vlan':
|
||||||
del data['vlan_id']
|
del data['vlan_id']
|
||||||
else:
|
else:
|
||||||
data['vlan_id'] = unicode(data['vlan_id'])
|
data['vlan_id'] = str(data['vlan_id'])
|
||||||
|
|
||||||
network_ids = []
|
network_ids = []
|
||||||
network_types = []
|
network_types = []
|
||||||
|
@ -564,7 +564,7 @@ class AddInterface(forms.SelfHandlingForm):
|
||||||
for network_type in network_types):
|
for network_type in network_types):
|
||||||
del data['imtu']
|
del data['imtu']
|
||||||
else:
|
else:
|
||||||
data['imtu'] = unicode(data['imtu'])
|
data['imtu'] = str(data['imtu'])
|
||||||
|
|
||||||
if data['iftype'] != 'ae':
|
if data['iftype'] != 'ae':
|
||||||
del data['txhashpolicy']
|
del data['txhashpolicy']
|
||||||
|
@ -798,9 +798,9 @@ class UpdateInterface(AddInterface):
|
||||||
if not data['vlan_id'] or data['iftype'] != 'vlan':
|
if not data['vlan_id'] or data['iftype'] != 'vlan':
|
||||||
del data['vlan_id']
|
del data['vlan_id']
|
||||||
else:
|
else:
|
||||||
data['vlan_id'] = unicode(data['vlan_id'])
|
data['vlan_id'] = str(data['vlan_id'])
|
||||||
|
|
||||||
data['imtu'] = unicode(data['imtu'])
|
data['imtu'] = str(data['imtu'])
|
||||||
|
|
||||||
if data['iftype'] != 'ae':
|
if data['iftype'] != 'ae':
|
||||||
del data['txhashpolicy']
|
del data['txhashpolicy']
|
||||||
|
@ -826,7 +826,7 @@ class UpdateInterface(AddInterface):
|
||||||
del data['providernetworks']
|
del data['providernetworks']
|
||||||
|
|
||||||
if 'sriov_numvfs' in data:
|
if 'sriov_numvfs' in data:
|
||||||
data['sriov_numvfs'] = unicode(data['sriov_numvfs'])
|
data['sriov_numvfs'] = str(data['sriov_numvfs'])
|
||||||
|
|
||||||
# Explicitly set iftype when user selects pci-pt or pci-sriov
|
# Explicitly set iftype when user selects pci-pt or pci-sriov
|
||||||
ifclass = \
|
ifclass = \
|
||||||
|
@ -852,15 +852,15 @@ class UpdateInterface(AddInterface):
|
||||||
del data['sriov_numvfs']
|
del data['sriov_numvfs']
|
||||||
|
|
||||||
if data['networks']:
|
if data['networks']:
|
||||||
data['networks'] = unicode(",".join(data['networks']))
|
data['networks'] = str(",".join(data['networks']))
|
||||||
else:
|
else:
|
||||||
del data['networks']
|
del data['networks']
|
||||||
if data['networks_to_add']:
|
if data['networks_to_add']:
|
||||||
data['networks_to_add'] = unicode(",".join(data['networks_to_add']))
|
data['networks_to_add'] = str(",".join(data['networks_to_add']))
|
||||||
else:
|
else:
|
||||||
del data['networks_to_add']
|
del data['networks_to_add']
|
||||||
if data['interface_networks_to_remove']:
|
if data['interface_networks_to_remove']:
|
||||||
data['interface_networks_to_remove'] = unicode(
|
data['interface_networks_to_remove'] = str(
|
||||||
",".join(data['interface_networks_to_remove']))
|
",".join(data['interface_networks_to_remove']))
|
||||||
else:
|
else:
|
||||||
del data['interface_networks_to_remove']
|
del data['interface_networks_to_remove']
|
||||||
|
|
|
@ -30,16 +30,16 @@ class DeleteRoute(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Route",
|
"Delete Route",
|
||||||
u"Delete Routes",
|
"Delete Routes",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Route",
|
"Deleted Route",
|
||||||
u"Deleted Routes",
|
"Deleted Routes",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class RouteTable(tables.DataTable):
|
||||||
verbose_name=_("Metric"))
|
verbose_name=_("Metric"))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return ("%(network)s/%(prefix)s via %(gateway)s" %
|
return ("%(network)s/%(prefix)s via %(gateway)s" %
|
||||||
|
|
|
@ -25,16 +25,16 @@ class DeleteInterface(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Interface",
|
"Delete Interface",
|
||||||
u"Delete Interfaces",
|
"Delete Interfaces",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Interface",
|
"Deleted Interface",
|
||||||
u"Deleted Interfaces",
|
"Deleted Interfaces",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ class InterfacesTable(tables.DataTable):
|
||||||
super(InterfacesTable, self).__init__(*args, **kwargs)
|
super(InterfacesTable, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.ifname
|
return datum.ifname
|
||||||
|
|
|
@ -33,7 +33,7 @@ class LldpNeighboursTable(tables.DataTable):
|
||||||
verbose_name=_('Max Frame Size'))
|
verbose_name=_('Max Frame Size'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.get_local_port_display_name()
|
return datum.get_local_port_display_name()
|
||||||
|
|
|
@ -80,7 +80,7 @@ class MemorysTable(tables.DataTable):
|
||||||
verbose_name=_('VM Pages'))
|
verbose_name=_('VM Pages'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "memorys"
|
name = "memorys"
|
||||||
|
|
|
@ -75,7 +75,7 @@ class PortsTable(tables.DataTable):
|
||||||
verbose_name=_('Device Type'))
|
verbose_name=_('Device Type'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.get_port_display_name()
|
return datum.get_port_display_name()
|
||||||
|
|
|
@ -188,9 +188,9 @@ class UpdateSensorGroup(forms.SelfHandlingForm):
|
||||||
# host_uuid = data['host_uuid']
|
# host_uuid = data['host_uuid']
|
||||||
if data['audit_interval_group']:
|
if data['audit_interval_group']:
|
||||||
data['audit_interval_group'] = \
|
data['audit_interval_group'] = \
|
||||||
unicode(data['audit_interval_group'])
|
str(data['audit_interval_group'])
|
||||||
else:
|
else:
|
||||||
data['audit_interval_group'] = unicode("0")
|
data['audit_interval_group'] = str("0")
|
||||||
|
|
||||||
del data['id']
|
del data['id']
|
||||||
|
|
||||||
|
|
|
@ -105,16 +105,16 @@ class SuppressSensorGroup(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Suppress SensorGroup",
|
"Suppress SensorGroup",
|
||||||
u"Suppress SensorGroups",
|
"Suppress SensorGroups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Suppressed SensorGroup",
|
"Suppressed SensorGroup",
|
||||||
u"Suppressed SensorGroups",
|
"Suppressed SensorGroups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -140,16 +140,16 @@ class UnSuppressSensorGroup(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"UnSuppress SensorGroup",
|
"UnSuppress SensorGroup",
|
||||||
u"UnSuppress SensorGroups",
|
"UnSuppress SensorGroups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"UnSuppressed SensorGroup",
|
"UnSuppressed SensorGroup",
|
||||||
u"UnSuppressed SensorGroups",
|
"UnSuppressed SensorGroups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ class SensorGroupsTable(tables.DataTable):
|
||||||
"are suppressed."))
|
"are suppressed."))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.sensorgroupname
|
return datum.sensorgroupname
|
||||||
|
@ -291,16 +291,16 @@ class SuppressSensor(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Suppress Sensor",
|
"Suppress Sensor",
|
||||||
u"Suppress Sensors",
|
"Suppress Sensors",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Suppressed Sensor",
|
"Suppressed Sensor",
|
||||||
u"Suppressed Sensors",
|
"Suppressed Sensors",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -325,16 +325,16 @@ class UnSuppressSensor(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"UnSuppress Sensor",
|
"UnSuppress Sensor",
|
||||||
u"UnSuppress Sensors",
|
"UnSuppress Sensors",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"UnSuppressed Sensor",
|
"UnSuppressed Sensor",
|
||||||
u"UnSuppressed Sensors",
|
"UnSuppressed Sensors",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ class SensorsTable(tables.DataTable):
|
||||||
verbose_name=('Sensor Group Name'))
|
verbose_name=('Sensor Group Name'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.sensorname
|
return datum.sensorname
|
||||||
|
|
|
@ -95,16 +95,16 @@ class DeletePartition(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Partition",
|
"Delete Partition",
|
||||||
u"Delete Partitions",
|
"Delete Partitions",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Partition",
|
"Deleted Partition",
|
||||||
u"Deleted Partitions",
|
"Deleted Partitions",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ class DisksTable(tables.DataTable):
|
||||||
verbose_name=('Model'))
|
verbose_name=('Model'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "disks"
|
name = "disks"
|
||||||
|
@ -300,16 +300,16 @@ class DeleteStor(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Journal",
|
"Delete Journal",
|
||||||
u"Delete Journals",
|
"Delete Journals",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Journal",
|
"Deleted Journal",
|
||||||
u"Deleted Journals",
|
"Deleted Journals",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ class StorageVolumesTable(tables.DataTable):
|
||||||
verbose_name=('Journal Location'))
|
verbose_name=('Journal Location'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "storagevolumes"
|
name = "storagevolumes"
|
||||||
|
@ -413,16 +413,16 @@ class RemoveLocalVolumeGroup(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Local Volume Group",
|
"Delete Local Volume Group",
|
||||||
u"Delete Local Volume Groups",
|
"Delete Local Volume Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Local Volume Group",
|
"Deleted Local Volume Group",
|
||||||
u"Deleted Local Volume Groups",
|
"Deleted Local Volume Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -472,13 +472,13 @@ class LocalVolumeGroupsTable(tables.DataTable):
|
||||||
verbose_name=('Current Logical Volumes'))
|
verbose_name=('Current Logical Volumes'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
msg = datum.uuid
|
msg = datum.uuid
|
||||||
if datum.lvm_vg_name:
|
if datum.lvm_vg_name:
|
||||||
msg += " (%s)" % datum.lvm_vg_name
|
msg += " (%s)" % datum.lvm_vg_name
|
||||||
return unicode(msg)
|
return str(msg)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "localvolumegroups"
|
name = "localvolumegroups"
|
||||||
|
@ -534,16 +534,16 @@ class RemovePhysicalVolume(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Physical Volume",
|
"Delete Physical Volume",
|
||||||
u"Delete Physical Volumes",
|
"Delete Physical Volumes",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Physical Volume",
|
"Deleted Physical Volume",
|
||||||
u"Deleted Physical Volumes",
|
"Deleted Physical Volumes",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -591,13 +591,13 @@ class PhysicalVolumesTable(tables.DataTable):
|
||||||
verbose_name=('LVM Volume Group Name'))
|
verbose_name=('LVM Volume Group Name'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
msg = datum.uuid
|
msg = datum.uuid
|
||||||
if datum.lvm_pv_name:
|
if datum.lvm_pv_name:
|
||||||
msg += " (%s)" % datum.lvm_pv_name
|
msg += " (%s)" % datum.lvm_pv_name
|
||||||
return unicode(msg)
|
return str(msg)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "physicalvolumes"
|
name = "physicalvolumes"
|
||||||
|
@ -627,13 +627,13 @@ class PartitionsTable(tables.DataTable):
|
||||||
verbose_name=('Status'))
|
verbose_name=('Status'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
msg = datum.uuid
|
msg = datum.uuid
|
||||||
if datum.device_path:
|
if datum.device_path:
|
||||||
msg += " (%s)" % datum.device_path
|
msg += " (%s)" % datum.device_path
|
||||||
return unicode(msg)
|
return str(msg)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "partitions"
|
name = "partitions"
|
||||||
|
|
|
@ -134,16 +134,16 @@ class DeleteHost(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Host",
|
"Delete Host",
|
||||||
u"Delete Hosts",
|
"Delete Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Host",
|
"Deleted Host",
|
||||||
u"Deleted Hosts",
|
"Deleted Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -164,16 +164,16 @@ class LockHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Lock Host",
|
"Lock Host",
|
||||||
u"Lock Hosts",
|
"Lock Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Locking Host",
|
"Locking Host",
|
||||||
u"Locking Hosts",
|
"Locking Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -197,16 +197,16 @@ class ForceLockHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Force Lock Host",
|
"Force Lock Host",
|
||||||
u"Force Lock Hosts",
|
"Force Lock Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Forced Lock Host",
|
"Forced Lock Host",
|
||||||
u"Forced Lock Hosts",
|
"Forced Lock Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -264,16 +264,16 @@ class UnlockHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Unlock Host",
|
"Unlock Host",
|
||||||
u"Unlock Hosts",
|
"Unlock Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Unlocked Host",
|
"Unlocked Host",
|
||||||
u"Unlocked Hosts",
|
"Unlocked Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -298,16 +298,16 @@ class ForceUnlockHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Force Unlock Host",
|
"Force Unlock Host",
|
||||||
u"Force Unlock Hosts",
|
"Force Unlock Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Forced Unlock Host",
|
"Forced Unlock Host",
|
||||||
u"Forced Unlock Hosts",
|
"Forced Unlock Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -337,16 +337,16 @@ class PowerOnHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Power On Host",
|
"Power On Host",
|
||||||
u"Power On Hosts",
|
"Power On Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Powered On Host",
|
"Powered On Host",
|
||||||
u"Powered On Hosts",
|
"Powered On Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -368,16 +368,16 @@ class PowerOffHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Power Off Host",
|
"Power Off Host",
|
||||||
u"Power Off Hosts",
|
"Power Off Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Powered Off Host",
|
"Powered Off Host",
|
||||||
u"Powered Off Hosts",
|
"Powered Off Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -400,16 +400,16 @@ class ResetHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Reset Host",
|
"Reset Host",
|
||||||
u"Reset Hosts",
|
"Reset Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Reset Host",
|
"Reset Host",
|
||||||
u"Reset Hosts",
|
"Reset Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -431,16 +431,16 @@ class RebootHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Reboot Host",
|
"Reboot Host",
|
||||||
u"Reboot Hosts",
|
"Reboot Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Rebooted Host",
|
"Rebooted Host",
|
||||||
u"Rebooted Hosts",
|
"Rebooted Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -461,16 +461,16 @@ class ReinstallHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Reinstall Host",
|
"Reinstall Host",
|
||||||
u"Reinstall Hosts",
|
"Reinstall Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Reinstalled Host",
|
"Reinstalled Host",
|
||||||
u"Reinstalled Hosts",
|
"Reinstalled Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -491,16 +491,16 @@ class SwactHost(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Swact Host",
|
"Swact Host",
|
||||||
u"Swact Hosts",
|
"Swact Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Swact Initiated Host",
|
"Swact Initiated Host",
|
||||||
u"Swact Initiated Hosts",
|
"Swact Initiated Hosts",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -521,16 +521,16 @@ class PatchInstallAsync(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Install Patch",
|
"Install Patch",
|
||||||
u"Install Patches",
|
"Install Patches",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Installed Patch",
|
"Installed Patch",
|
||||||
u"Installed Patches",
|
"Installed Patches",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -664,7 +664,7 @@ def get_task_or_status(host):
|
||||||
patch_current = "Not Patch Current"
|
patch_current = "Not Patch Current"
|
||||||
|
|
||||||
if host._patch_state != patch_constants.PATCH_AGENT_STATE_IDLE:
|
if host._patch_state != patch_constants.PATCH_AGENT_STATE_IDLE:
|
||||||
patch_state = unicode(host.patch_state)
|
patch_state = str(host.patch_state)
|
||||||
if host._patch_state == patch_constants.PATCH_AGENT_STATE_INSTALLING:
|
if host._patch_state == patch_constants.PATCH_AGENT_STATE_INSTALLING:
|
||||||
# Clear the other patch status fields
|
# Clear the other patch status fields
|
||||||
patch_current = ""
|
patch_current = ""
|
||||||
|
@ -740,7 +740,7 @@ class Hosts(tables.DataTable):
|
||||||
status_choices=TASK_STATE_CHOICES)
|
status_choices=TASK_STATE_CHOICES)
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.id)
|
return str(datum.id)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.hostname
|
return datum.hostname
|
||||||
|
@ -823,16 +823,16 @@ class DeleteInterfaceProfile(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Interface Profile",
|
"Delete Interface Profile",
|
||||||
u"Delete Interface Profiles",
|
"Delete Interface Profiles",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Interface Profile",
|
"Deleted Interface Profile",
|
||||||
u"Deleted Interface Profiles",
|
"Deleted Interface Profiles",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -871,7 +871,7 @@ class InterfaceProfilesTable(tables.DataTable):
|
||||||
verbose_name=_("Interface Configuration"))
|
verbose_name=_("Interface Configuration"))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.profilename
|
return datum.profilename
|
||||||
|
@ -888,16 +888,16 @@ class DeleteCpuProfile(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Cpu Profile",
|
"Delete Cpu Profile",
|
||||||
u"Delete Cpu Profiles",
|
"Delete Cpu Profiles",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Cpu Profile",
|
"Deleted Cpu Profile",
|
||||||
u"Deleted Cpu Profiles",
|
"Deleted Cpu Profiles",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -926,7 +926,7 @@ class CpuProfilesTable(tables.DataTable):
|
||||||
verbose_name=_("CPU Assignments"))
|
verbose_name=_("CPU Assignments"))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.profilename
|
return datum.profilename
|
||||||
|
@ -944,16 +944,16 @@ class DeleteDiskProfile(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Storage Profile",
|
"Delete Storage Profile",
|
||||||
u"Delete Storage Profiles",
|
"Delete Storage Profiles",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Storage Profile",
|
"Deleted Storage Profile",
|
||||||
u"Deleted Storage Profiles",
|
"Deleted Storage Profiles",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1022,7 +1022,7 @@ class DiskProfilesTable(tables.DataTable):
|
||||||
verbose_name=_('Observations'))
|
verbose_name=_('Observations'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.profilename
|
return datum.profilename
|
||||||
|
@ -1040,16 +1040,16 @@ class DeleteMemoryProfile(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Memory Profile",
|
"Delete Memory Profile",
|
||||||
u"Delete Memory Profiles",
|
"Delete Memory Profiles",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Memory Profile",
|
"Deleted Memory Profile",
|
||||||
u"Deleted Memory Profiles",
|
"Deleted Memory Profiles",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1089,7 +1089,7 @@ class MemoryProfilesTable(tables.DataTable):
|
||||||
verbose_name=_("Memory Assignments"))
|
verbose_name=_("Memory Assignments"))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.profilename
|
return datum.profilename
|
||||||
|
|
|
@ -39,16 +39,16 @@ class DeleteProviderNetworkRange(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Range",
|
"Delete Range",
|
||||||
u"Delete Ranges",
|
"Delete Ranges",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Range",
|
"Deleted Range",
|
||||||
u"Deleted Ranges",
|
"Deleted Ranges",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -37,16 +37,16 @@ class DeleteProviderNetwork(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Provider Network",
|
"Delete Provider Network",
|
||||||
u"Delete Provider Networks",
|
"Delete Provider Networks",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Provider Network",
|
"Deleted Provider Network",
|
||||||
u"Deleted Provider Networks",
|
"Deleted Provider Networks",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,306 +1,306 @@
|
||||||
# Copyright 2014 Wind River, Inc.
|
# Copyright 2014 Wind River, Inc.
|
||||||
# Copyright 2012 Nebula, Inc.
|
# Copyright 2012 Nebula, Inc.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# 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
|
# not use this file except in compliance with the License. You may obtain
|
||||||
# a copy of the License at
|
# a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Wind River Systems, Inc.
|
# Copyright (c) 2013-2017 Wind River Systems, Inc.
|
||||||
#
|
#
|
||||||
|
|
||||||
from django.core.urlresolvers import NoReverseMatch
|
from django.core.urlresolvers import NoReverseMatch
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.utils import html
|
from django.utils import html
|
||||||
from django.utils import safestring
|
from django.utils import safestring
|
||||||
from django.utils.translation import string_concat
|
from django.utils.translation import string_concat
|
||||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||||
from django.utils.translation import ungettext_lazy
|
from django.utils.translation import ungettext_lazy
|
||||||
|
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
|
|
||||||
from openstack_dashboard import api
|
from openstack_dashboard import api
|
||||||
from openstack_dashboard.api import nova
|
from openstack_dashboard.api import nova
|
||||||
from openstack_dashboard.dashboards.project.volumes.tables \
|
from openstack_dashboard.dashboards.project.volumes.tables \
|
||||||
import get_attachment_name
|
import get_attachment_name
|
||||||
from openstack_dashboard.usage import quotas
|
from openstack_dashboard.usage import quotas
|
||||||
|
|
||||||
from starlingx_dashboard.api import nova as stx_nova
|
from starlingx_dashboard.api import nova as stx_nova
|
||||||
|
|
||||||
DELETABLE_STATES = ("available", "error")
|
DELETABLE_STATES = ("available", "error")
|
||||||
|
|
||||||
|
|
||||||
class DeleteServerGroup(tables.DeleteAction):
|
class DeleteServerGroup(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Server Group",
|
"Delete Server Group",
|
||||||
u"Delete Server Groups",
|
"Delete Server Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Server Group",
|
"Deleted Server Group",
|
||||||
u"Deleted Server Groups",
|
"Deleted Server Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
def delete(self, request, obj_id):
|
def delete(self, request, obj_id):
|
||||||
obj = self.table.get_object_by_id(obj_id)
|
obj = self.table.get_object_by_id(obj_id)
|
||||||
name = self.table.get_object_display(obj)
|
name = self.table.get_object_display(obj)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
stx_nova.server_group_delete(request, obj_id)
|
stx_nova.server_group_delete(request, obj_id)
|
||||||
except Exception:
|
except Exception:
|
||||||
msg = _('Unable to delete group "%s" because it is not empty. '
|
msg = _('Unable to delete group "%s" because it is not empty. '
|
||||||
'Either delete the member instances'
|
'Either delete the member instances'
|
||||||
' or remove them from the group.')
|
' or remove them from the group.')
|
||||||
exceptions.check_message(["group", "not", "empty."], msg % name)
|
exceptions.check_message(["group", "not", "empty."], msg % name)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# maybe do a precheck to see if the group is empty first?
|
# maybe do a precheck to see if the group is empty first?
|
||||||
def allowed(self, request, server_group=None):
|
def allowed(self, request, server_group=None):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class CreateServerGroup(tables.LinkAction):
|
class CreateServerGroup(tables.LinkAction):
|
||||||
name = "create"
|
name = "create"
|
||||||
verbose_name = _("Create Server Group")
|
verbose_name = _("Create Server Group")
|
||||||
url = "horizon:admin:server_groups:create"
|
url = "horizon:admin:server_groups:create"
|
||||||
classes = ("ajax-modal", "btn-create")
|
classes = ("ajax-modal", "btn-create")
|
||||||
icon = "plus"
|
icon = "plus"
|
||||||
|
|
||||||
def allowed(self, request, volume=None):
|
def allowed(self, request, volume=None):
|
||||||
usages = quotas.tenant_quota_usages(request)
|
usages = quotas.tenant_quota_usages(request)
|
||||||
if usages['server_groups']['available'] <= 0:
|
if usages['server_groups']['available'] <= 0:
|
||||||
if "disabled" not in self.classes:
|
if "disabled" not in self.classes:
|
||||||
self.classes = [c for c in self.classes] + ['disabled']
|
self.classes = [c for c in self.classes] + ['disabled']
|
||||||
self.verbose_name = string_concat(self.verbose_name, ' ',
|
self.verbose_name = string_concat(self.verbose_name, ' ',
|
||||||
_("(Quota exceeded)"))
|
_("(Quota exceeded)"))
|
||||||
else:
|
else:
|
||||||
self.verbose_name = _("Create Server Group")
|
self.verbose_name = _("Create Server Group")
|
||||||
classes = [c for c in self.classes if c != "disabled"]
|
classes = [c for c in self.classes if c != "disabled"]
|
||||||
self.classes = classes
|
self.classes = classes
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class EditAttachments(tables.LinkAction):
|
class EditAttachments(tables.LinkAction):
|
||||||
name = "attachments"
|
name = "attachments"
|
||||||
verbose_name = _("Edit Attachments")
|
verbose_name = _("Edit Attachments")
|
||||||
url = "horizon:admin:server_groups:attach"
|
url = "horizon:admin:server_groups:attach"
|
||||||
classes = ("ajax-modal", "btn-edit")
|
classes = ("ajax-modal", "btn-edit")
|
||||||
|
|
||||||
def allowed(self, request, server_group=None):
|
def allowed(self, request, server_group=None):
|
||||||
return True # volume.status in ("available", "in-use")
|
return True # volume.status in ("available", "in-use")
|
||||||
|
|
||||||
|
|
||||||
class CreateSnapshot(tables.LinkAction):
|
class CreateSnapshot(tables.LinkAction):
|
||||||
name = "snapshots"
|
name = "snapshots"
|
||||||
verbose_name = _("Create Snapshot")
|
verbose_name = _("Create Snapshot")
|
||||||
url = "horizon:admin:server_groups:create_snapshot"
|
url = "horizon:admin:server_groups:create_snapshot"
|
||||||
classes = ("ajax-modal", "btn-camera")
|
classes = ("ajax-modal", "btn-camera")
|
||||||
|
|
||||||
def allowed(self, request, server_group=None):
|
def allowed(self, request, server_group=None):
|
||||||
return True # server_group.status == "available"
|
return True # server_group.status == "available"
|
||||||
|
|
||||||
|
|
||||||
class UpdateRow(tables.Row):
|
class UpdateRow(tables.Row):
|
||||||
ajax = True
|
ajax = True
|
||||||
|
|
||||||
def get_data(self, request, server_group_id):
|
def get_data(self, request, server_group_id):
|
||||||
server_group = stx_nova.server_group_get(request, server_group_id)
|
server_group = stx_nova.server_group_get(request, server_group_id)
|
||||||
if not server_group.name:
|
if not server_group.name:
|
||||||
server_group.name = server_group_id
|
server_group.name = server_group_id
|
||||||
|
|
||||||
return server_group
|
return server_group
|
||||||
|
|
||||||
|
|
||||||
def get_policies(server_group):
|
def get_policies(server_group):
|
||||||
policies = ', '.join(server_group.policies)
|
policies = ', '.join(server_group.policies)
|
||||||
return policies
|
return policies
|
||||||
|
|
||||||
|
|
||||||
def get_metadata(server_group):
|
def get_metadata(server_group):
|
||||||
metadata_items = ['{}:{}'.format(x, y) for x, y in
|
metadata_items = ['{}:{}'.format(x, y) for x, y in
|
||||||
server_group.metadata.items()]
|
server_group.metadata.items()]
|
||||||
metadata = ', '.join(metadata_items)
|
metadata = ', '.join(metadata_items)
|
||||||
return metadata
|
return metadata
|
||||||
|
|
||||||
|
|
||||||
def get_member_name(request, server_id):
|
def get_member_name(request, server_id):
|
||||||
try:
|
try:
|
||||||
server = api.nova.server_get(request, server_id)
|
server = api.nova.server_get(request, server_id)
|
||||||
name = server.name
|
name = server.name
|
||||||
except Exception:
|
except Exception:
|
||||||
name = None
|
name = None
|
||||||
exceptions.handle(request, _("Unable to retrieve "
|
exceptions.handle(request, _("Unable to retrieve "
|
||||||
"member information."))
|
"member information."))
|
||||||
# try and get a URL
|
# try and get a URL
|
||||||
try:
|
try:
|
||||||
url = reverse("horizon:admin:instances:detail", args=(server_id,))
|
url = reverse("horizon:admin:instances:detail", args=(server_id,))
|
||||||
instance = '<a href="%s">%s</a>' % (url, html.escape(name))
|
instance = '<a href="%s">%s</a>' % (url, html.escape(name))
|
||||||
except NoReverseMatch:
|
except NoReverseMatch:
|
||||||
instance = name
|
instance = name
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
|
||||||
class ProjectNameColumn(tables.Column):
|
class ProjectNameColumn(tables.Column):
|
||||||
"""Customized column class
|
"""Customized column class
|
||||||
|
|
||||||
Customized column class that does complex processing on the
|
Customized column class that does complex processing on the
|
||||||
server group.
|
server group.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def get_raw_data(self, server_group):
|
def get_raw_data(self, server_group):
|
||||||
request = self.table.request
|
request = self.table.request
|
||||||
project_id = getattr(server_group, 'project_id', None)
|
project_id = getattr(server_group, 'project_id', None)
|
||||||
try:
|
try:
|
||||||
tenant = api.keystone.tenant_get(request,
|
tenant = api.keystone.tenant_get(request,
|
||||||
project_id,
|
project_id,
|
||||||
admin=True)
|
admin=True)
|
||||||
|
|
||||||
project_name = getattr(tenant, "name", None)
|
project_name = getattr(tenant, "name", None)
|
||||||
except Exception:
|
except Exception:
|
||||||
project_name = "(not found)"
|
project_name = "(not found)"
|
||||||
|
|
||||||
return project_name
|
return project_name
|
||||||
|
|
||||||
|
|
||||||
class MemberColumn(tables.Column):
|
class MemberColumn(tables.Column):
|
||||||
"""Customized column class
|
"""Customized column class
|
||||||
|
|
||||||
Customized column class that does complex processing on the instances
|
Customized column class that does complex processing on the instances
|
||||||
in a server group. This was substantially copied
|
in a server group. This was substantially copied
|
||||||
from the volume equivalent.
|
from the volume equivalent.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def get_raw_data(self, server_group):
|
def get_raw_data(self, server_group):
|
||||||
request = self.table.request
|
request = self.table.request
|
||||||
link = _('%(name)s (%(id)s)')
|
link = _('%(name)s (%(id)s)')
|
||||||
members = []
|
members = []
|
||||||
for member in server_group.members:
|
for member in server_group.members:
|
||||||
member_id = member
|
member_id = member
|
||||||
name = get_member_name(request, member)
|
name = get_member_name(request, member)
|
||||||
vals = {"name": name, "id": member_id}
|
vals = {"name": name, "id": member_id}
|
||||||
members.append(link % vals)
|
members.append(link % vals)
|
||||||
return safestring.mark_safe(", ".join(members))
|
return safestring.mark_safe(", ".join(members))
|
||||||
|
|
||||||
|
|
||||||
def get_server_group_type(server_group):
|
def get_server_group_type(server_group):
|
||||||
return server_group.volume_type if server_group.volume_type != "None" \
|
return server_group.volume_type if server_group.volume_type != "None" \
|
||||||
else None
|
else None
|
||||||
|
|
||||||
|
|
||||||
class ServerGroupsFilterAction(tables.FilterAction):
|
class ServerGroupsFilterAction(tables.FilterAction):
|
||||||
def filter(self, table, server_groups, filter_string):
|
def filter(self, table, server_groups, filter_string):
|
||||||
"""Naive case-insensitive search."""
|
"""Naive case-insensitive search."""
|
||||||
q = filter_string.lower()
|
q = filter_string.lower()
|
||||||
return [group for group in server_groups
|
return [group for group in server_groups
|
||||||
if q in group.display_name.lower()]
|
if q in group.display_name.lower()]
|
||||||
|
|
||||||
|
|
||||||
class ServerGroupsTable(tables.DataTable):
|
class ServerGroupsTable(tables.DataTable):
|
||||||
projectname = ProjectNameColumn("project_name",
|
projectname = ProjectNameColumn("project_name",
|
||||||
verbose_name=_("Project"))
|
verbose_name=_("Project"))
|
||||||
name = tables.Column("name",
|
name = tables.Column("name",
|
||||||
verbose_name=_("Group Name"),
|
verbose_name=_("Group Name"),
|
||||||
link="horizon:admin:server_groups:detail")
|
link="horizon:admin:server_groups:detail")
|
||||||
policies = tables.Column(get_policies,
|
policies = tables.Column(get_policies,
|
||||||
verbose_name=_("Policies"))
|
verbose_name=_("Policies"))
|
||||||
members = MemberColumn("members",
|
members = MemberColumn("members",
|
||||||
verbose_name=_("Members"))
|
verbose_name=_("Members"))
|
||||||
metadata = tables.Column(get_metadata,
|
metadata = tables.Column(get_metadata,
|
||||||
verbose_name=_("Metadata"))
|
verbose_name=_("Metadata"))
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "server_groups"
|
name = "server_groups"
|
||||||
verbose_name = _("Server Groups")
|
verbose_name = _("Server Groups")
|
||||||
row_class = UpdateRow
|
row_class = UpdateRow
|
||||||
table_actions = (
|
table_actions = (
|
||||||
CreateServerGroup, DeleteServerGroup, ServerGroupsFilterAction)
|
CreateServerGroup, DeleteServerGroup, ServerGroupsFilterAction)
|
||||||
row_actions = (DeleteServerGroup,)
|
row_actions = (DeleteServerGroup,)
|
||||||
|
|
||||||
def get_object_display(self, obj):
|
def get_object_display(self, obj):
|
||||||
return obj.name
|
return obj.name
|
||||||
|
|
||||||
|
|
||||||
class DetachServerGroup(tables.BatchAction):
|
class DetachServerGroup(tables.BatchAction):
|
||||||
name = "detach"
|
name = "detach"
|
||||||
action_type = 'danger'
|
action_type = 'danger'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Detach Server Group",
|
"Detach Server Group",
|
||||||
u"Detached Server Groups",
|
"Detached Server Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Detaching Server Group",
|
"Detaching Server Group",
|
||||||
u"Detaching Server Groups",
|
"Detaching Server Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
def action(self, request, obj_id):
|
def action(self, request, obj_id):
|
||||||
attachment = self.table.get_object_by_id(obj_id)
|
attachment = self.table.get_object_by_id(obj_id)
|
||||||
api.nova.instance_server_group_detach(request,
|
api.nova.instance_server_group_detach(request,
|
||||||
attachment.get('server_id',
|
attachment.get('server_id',
|
||||||
None),
|
None),
|
||||||
obj_id)
|
obj_id)
|
||||||
|
|
||||||
def get_success_url(self, request):
|
def get_success_url(self, request):
|
||||||
return reverse('horizon:admin:server_groups:index')
|
return reverse('horizon:admin:server_groups:index')
|
||||||
|
|
||||||
|
|
||||||
class AttachedInstanceColumn(tables.Column):
|
class AttachedInstanceColumn(tables.Column):
|
||||||
"""Customized column class
|
"""Customized column class
|
||||||
|
|
||||||
Customized column class that does complex processing on the attachments
|
Customized column class that does complex processing on the attachments
|
||||||
for a server group.
|
for a server group.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def get_raw_data(self, attachment):
|
def get_raw_data(self, attachment):
|
||||||
request = self.table.request
|
request = self.table.request
|
||||||
return safestring.mark_safe(get_attachment_name(request, attachment,
|
return safestring.mark_safe(get_attachment_name(request, attachment,
|
||||||
True))
|
True))
|
||||||
|
|
||||||
|
|
||||||
class AttachmentsTable(tables.DataTable):
|
class AttachmentsTable(tables.DataTable):
|
||||||
instance = AttachedInstanceColumn(get_member_name,
|
instance = AttachedInstanceColumn(get_member_name,
|
||||||
verbose_name=_("Instance"))
|
verbose_name=_("Instance"))
|
||||||
device = tables.Column("device",
|
device = tables.Column("device",
|
||||||
verbose_name=_("Device"))
|
verbose_name=_("Device"))
|
||||||
|
|
||||||
def get_object_id(self, obj):
|
def get_object_id(self, obj):
|
||||||
return obj['id']
|
return obj['id']
|
||||||
|
|
||||||
def get_object_display(self, attachment):
|
def get_object_display(self, attachment):
|
||||||
instance_name = get_attachment_name(self.request, attachment, True)
|
instance_name = get_attachment_name(self.request, attachment, True)
|
||||||
vals = {"dev": attachment['device'],
|
vals = {"dev": attachment['device'],
|
||||||
"instance_name": html.strip_tags(instance_name)}
|
"instance_name": html.strip_tags(instance_name)}
|
||||||
return _("%(dev)s on instance %(instance_name)s") % vals
|
return _("%(dev)s on instance %(instance_name)s") % vals
|
||||||
|
|
||||||
def get_object_by_id(self, obj_id):
|
def get_object_by_id(self, obj_id):
|
||||||
for obj in self.data:
|
for obj in self.data:
|
||||||
if self.get_object_id(obj) == obj_id:
|
if self.get_object_id(obj) == obj_id:
|
||||||
return obj
|
return obj
|
||||||
raise ValueError('No match found for the id "%s".' % obj_id)
|
raise ValueError('No match found for the id "%s".' % obj_id)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "attachments"
|
name = "attachments"
|
||||||
verbose_name = _("Attachments")
|
verbose_name = _("Attachments")
|
||||||
table_actions = (DetachServerGroup,)
|
table_actions = (DetachServerGroup,)
|
||||||
row_actions = (DetachServerGroup,)
|
row_actions = (DetachServerGroup,)
|
||||||
|
|
|
@ -34,16 +34,16 @@ class ApplyPatch(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Apply Patch",
|
"Apply Patch",
|
||||||
u"Apply Patches",
|
"Apply Patches",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Applied Patch",
|
"Applied Patch",
|
||||||
u"Applied Patches",
|
"Applied Patches",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -67,16 +67,16 @@ class RemovePatch(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Remove Patch",
|
"Remove Patch",
|
||||||
u"Remove Patches",
|
"Remove Patches",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Removed Patch",
|
"Removed Patch",
|
||||||
u"Removed Patches",
|
"Removed Patches",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -108,16 +108,16 @@ class DeletePatch(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Patch",
|
"Delete Patch",
|
||||||
u"Delete Patches",
|
"Delete Patches",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Patch",
|
"Deleted Patch",
|
||||||
u"Deleted Patches",
|
"Deleted Patches",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -404,16 +404,16 @@ class ApplyStage(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Apply Stage",
|
"Apply Stage",
|
||||||
u"Apply Stages",
|
"Apply Stages",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Applied Stage",
|
"Applied Stage",
|
||||||
u"Applied Stages",
|
"Applied Stages",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -473,16 +473,16 @@ class AbortStage(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Abort Stage",
|
"Abort Stage",
|
||||||
u"Abort Stages",
|
"Abort Stages",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Aborted Stage",
|
"Aborted Stage",
|
||||||
u"Aborted Stages",
|
"Aborted Stages",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -30,16 +30,16 @@ class DeleteAddressPool(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Address Pool",
|
"Delete Address Pool",
|
||||||
u"Delete Address Pools",
|
"Delete Address Pools",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Address Pool",
|
"Deleted Address Pool",
|
||||||
u"Deleted Address Pools",
|
"Deleted Address Pools",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ class AddressPoolsTable(tables.DataTable):
|
||||||
ranges = tables.Column(get_ranges_column, verbose_name=_("Address Ranges"))
|
ranges = tables.Column(get_ranges_column, verbose_name=_("Address Ranges"))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return ("%(network)s/%(prefix)s" %
|
return ("%(network)s/%(prefix)s" %
|
||||||
|
|
|
@ -864,19 +864,19 @@ class UpdateiStoragePools(forms.SelfHandlingForm):
|
||||||
STORAGE_VALUES = {}
|
STORAGE_VALUES = {}
|
||||||
if hasattr(storage_config, 'cinder_pool_gib'):
|
if hasattr(storage_config, 'cinder_pool_gib'):
|
||||||
STORAGE_VALUES['cinder_pool_gib'] = \
|
STORAGE_VALUES['cinder_pool_gib'] = \
|
||||||
unicode(storage_config._cinder_pool_gib)
|
str(storage_config._cinder_pool_gib)
|
||||||
if hasattr(storage_config, 'glance_pool_gib'):
|
if hasattr(storage_config, 'glance_pool_gib'):
|
||||||
STORAGE_VALUES['glance_pool_gib'] = \
|
STORAGE_VALUES['glance_pool_gib'] = \
|
||||||
unicode(storage_config._glance_pool_gib)
|
str(storage_config._glance_pool_gib)
|
||||||
if hasattr(storage_config, 'ephemeral_pool_gib'):
|
if hasattr(storage_config, 'ephemeral_pool_gib'):
|
||||||
STORAGE_VALUES['ephemeral_pool_gib'] = \
|
STORAGE_VALUES['ephemeral_pool_gib'] = \
|
||||||
unicode(storage_config._ephemeral_pool_gib)
|
str(storage_config._ephemeral_pool_gib)
|
||||||
if hasattr(storage_config, 'object_pool_gib'):
|
if hasattr(storage_config, 'object_pool_gib'):
|
||||||
STORAGE_VALUES['object_pool_gib'] = \
|
STORAGE_VALUES['object_pool_gib'] = \
|
||||||
unicode(storage_config._object_pool_gib)
|
str(storage_config._object_pool_gib)
|
||||||
|
|
||||||
for key in data.keys():
|
for key in data.keys():
|
||||||
data[key] = unicode(data[key])
|
data[key] = str(data[key])
|
||||||
|
|
||||||
LOG.info("initial send_to_sysinv=%s", send_to_sysinv)
|
LOG.info("initial send_to_sysinv=%s", send_to_sysinv)
|
||||||
if len(STORAGE_VALUES) != len(data):
|
if len(STORAGE_VALUES) != len(data):
|
||||||
|
|
|
@ -63,7 +63,7 @@ class SystemsTable(tables.DataTable):
|
||||||
verbose_name=_("Version"))
|
verbose_name=_("Version"))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.name
|
return datum.name
|
||||||
|
@ -141,7 +141,7 @@ class cDNSTable(tables.DataTable):
|
||||||
verbose_name=_('DNS Server 3 IP'))
|
verbose_name=_('DNS Server 3 IP'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.uuid
|
return datum.uuid
|
||||||
|
@ -183,7 +183,7 @@ class cNTPTable(tables.DataTable):
|
||||||
verbose_name=_('NTP Server 3 Address'))
|
verbose_name=_('NTP Server 3 Address'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.uuid
|
return datum.uuid
|
||||||
|
@ -221,7 +221,7 @@ class cPTPTable(tables.DataTable):
|
||||||
verbose_name=_('PTP Delay Mechanism'))
|
verbose_name=_('PTP Delay Mechanism'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.uuid
|
return datum.uuid
|
||||||
|
@ -285,7 +285,7 @@ class cOAMTable(tables.DataTable):
|
||||||
verbose_name=_('OAM End IP'))
|
verbose_name=_('OAM End IP'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.uuid
|
return datum.uuid
|
||||||
|
@ -323,7 +323,7 @@ class iStorageTable(tables.DataTable):
|
||||||
verbose_name=_('Size (GiB)'))
|
verbose_name=_('Size (GiB)'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.name)
|
return str(datum.name)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return
|
return
|
||||||
|
@ -365,7 +365,7 @@ class iStoragePoolsTable(tables.DataTable):
|
||||||
verbose_name=_('Ceph total space (GiB)'))
|
verbose_name=_('Ceph total space (GiB)'))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return ("%s" % datum.tier_name)
|
return ("%s" % datum.tier_name)
|
||||||
|
@ -385,16 +385,16 @@ class DeleteSDNController(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete SDN Controller",
|
"Delete SDN Controller",
|
||||||
u"Delete SDN Controllers",
|
"Delete SDN Controllers",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted SDN Controller",
|
"Deleted SDN Controller",
|
||||||
u"Deleted SDN Controllers",
|
"Deleted SDN Controllers",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ class SDNControllerTable(tables.DataTable):
|
||||||
verbose_name=_("Remote Port"))
|
verbose_name=_("Remote Port"))
|
||||||
|
|
||||||
def get_object_id(self, datum):
|
def get_object_id(self, datum):
|
||||||
return unicode(datum.uuid)
|
return str(datum.uuid)
|
||||||
|
|
||||||
def get_object_display(self, datum):
|
def get_object_display(self, datum):
|
||||||
return datum.uuid
|
return datum.uuid
|
||||||
|
|
|
@ -271,16 +271,16 @@ class DeleteCloudPatchConfig(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Cloud Patching Configuration",
|
"Delete Cloud Patching Configuration",
|
||||||
u"Delete Cloud Patching Configurations",
|
"Delete Cloud Patching Configurations",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Cloud Patching Configuration",
|
"Deleted Cloud Patching Configuration",
|
||||||
u"Deleted Cloud Patching Configurations",
|
"Deleted Cloud Patching Configurations",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -45,16 +45,16 @@ class DeleteServerGroup(tables.DeleteAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Delete Server Group",
|
"Delete Server Group",
|
||||||
u"Delete Server Groups",
|
"Delete Server Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Server Group",
|
"Deleted Server Group",
|
||||||
u"Deleted Server Groups",
|
"Deleted Server Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -223,16 +223,16 @@ class DetachServerGroup(tables.BatchAction):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_present(count):
|
def action_present(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Server Group",
|
"Server Group",
|
||||||
u"Server Groups",
|
"Server Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def action_past(count):
|
def action_past(count):
|
||||||
return ungettext_lazy(
|
return ungettext_lazy(
|
||||||
u"Deleted Group",
|
"Deleted Group",
|
||||||
u"Deleted Groups",
|
"Deleted Groups",
|
||||||
count
|
count
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue