Fix the string coding inconsistency between python2 and python3

Change-Id: I0e926e58f65834205da028549d3a38df55c07f5e
Task: 24628
Story: 2003432
This commit is contained in:
hazelnutsgz 2018-10-19 13:15:59 +08:00
parent c069800adc
commit 9776a4d294
25 changed files with 538 additions and 538 deletions

View File

@ -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'),
] ]

View File

@ -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'),
] ]

View File

@ -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
) )

View File

@ -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"

View File

@ -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

View File

@ -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" %

View File

@ -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']

View File

@ -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" %

View File

@ -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

View File

@ -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()

View File

@ -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"

View File

@ -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()

View File

@ -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']

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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
) )

View File

@ -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
) )

View File

@ -42,16 +42,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
) )
@ -241,16 +241,16 @@ class DetachServerGroup(tables.BatchAction):
@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
) )

View File

@ -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
) )

View File

@ -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" %

View File

@ -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):

View File

@ -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

View File

@ -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
) )

View File

@ -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
) )