Drop unicode prefix

It is no longer required in Python 3 because strings are by default
unicode strings.

Change-Id: I0269ce5f4be61133a7244bb2fc386dc5f2ec736c
This commit is contained in:
Takashi Kajinami 2024-09-30 15:03:18 +09:00
parent be1481de61
commit d06457bccb
10 changed files with 41 additions and 41 deletions

View File

@ -61,7 +61,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
copyright = u'2010-present, OpenStack Foundation' copyright = '2010-present, OpenStack Foundation'
# openstackdocstheme options # openstackdocstheme options
openstackdocs_repo_name = 'openstack/heat' openstackdocs_repo_name = 'openstack/heat'
@ -99,7 +99,7 @@ pygments_style = 'native'
# -- Options for man page output ---------------------------------------------- # -- Options for man page output ----------------------------------------------
# Grouping the document tree for man pages. # Grouping the document tree for man pages.
# List of tuples 'sourcefile', 'target', u'title', u'Authors name', 'manual' # List of tuples 'sourcefile', 'target', 'title', 'Authors name', 'manual'
# -- Options for HTML output -------------------------------------------------- # -- Options for HTML output --------------------------------------------------
@ -185,8 +185,8 @@ htmlhelp_basename = 'heatdoc'
# (source start file, target name, title, author, documentclass # (source start file, target name, title, author, documentclass
# [howto/manual]). # [howto/manual]).
latex_documents = [ latex_documents = [
('index', 'Heat.tex', u'OpenStack Orchestration API Documentation', ('index', 'Heat.tex', 'OpenStack Orchestration API Documentation',
u'OpenStack Foundation', 'manual'), 'OpenStack Foundation', '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

View File

@ -128,7 +128,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
copyright = u'(c) 2012- Heat Developers' copyright = '(c) 2012- Heat Developers'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
@ -274,8 +274,8 @@ htmlhelp_basename = 'Heatdoc'
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]) # (source start file, target name, title, author, documentclass [howto/manual])
latex_documents = [ latex_documents = [
('index', 'doc-heat.tex', u'Heat Documentation', ('index', 'doc-heat.tex', 'Heat Documentation',
u'Heat Developers', 'manual'), 'Heat Developers', '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
@ -313,26 +313,26 @@ latex_elements = {
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [
('man/heat-api', 'heat-api', ('man/heat-api', 'heat-api',
u'REST API service to the heat project.', 'REST API service to the heat project.',
[u'Heat Developers'], 1), ['Heat Developers'], 1),
('man/heat-api-cfn', 'heat-api-cfn', ('man/heat-api-cfn', 'heat-api-cfn',
u'CloudFormation compatible API service to the heat project.', 'CloudFormation compatible API service to the heat project.',
[u'Heat Developers'], 1), ['Heat Developers'], 1),
('man/heat-db-setup', 'heat-db-setup', ('man/heat-db-setup', 'heat-db-setup',
u'Command line utility to setup the Heat database', 'Command line utility to setup the Heat database',
[u'Heat Developers'], 1), ['Heat Developers'], 1),
('man/heat-engine', 'heat-engine', ('man/heat-engine', 'heat-engine',
u'Service which performs the actions from the API calls made by the user', 'Service which performs the actions from the API calls made by the user',
[u'Heat Developers'], 1), ['Heat Developers'], 1),
('man/heat-keystone-setup-domain', 'heat-keystone-setup-domain', ('man/heat-keystone-setup-domain', 'heat-keystone-setup-domain',
u'Script which sets up a keystone domain for heat users and projects', 'Script which sets up a keystone domain for heat users and projects',
[u'Heat Developers'], 1), ['Heat Developers'], 1),
('man/heat-manage', 'heat-manage', ('man/heat-manage', 'heat-manage',
u'Script which helps manage specific database operations', 'Script which helps manage specific database operations',
[u'Heat Developers'], 1), ['Heat Developers'], 1),
('man/heat-status', 'heat-status', ('man/heat-status', 'heat-status',
u'Script to check status of Heat deployment.', 'Script to check status of Heat deployment.',
[u'Heat Developers'], 1), ['Heat Developers'], 1),
] ]
@ -346,8 +346,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', 'Heat', u'Heat Documentation', ('index', 'Heat', 'Heat Documentation',
u'Heat Developers', 'Heat', 'One line description of project.', 'Heat Developers', 'Heat', 'One line description of project.',
'Miscellaneous'), 'Miscellaneous'),
] ]

View File

@ -172,7 +172,7 @@ class ResourcePages(rst.Directive):
# Ignore title generated for list items # Ignore title generated for list items
if title != '*': if title != '*':
title = nodes.term('', title) title = nodes.term('', title)
ref = nodes.reference('', u'\xb6') ref = nodes.reference('', '\xb6')
ref['classes'] = ['headerlink'] ref['classes'] = ['headerlink']
ref['refid'] = id ref['refid'] = id
title.append(ref) title.append(ref)

View File

@ -139,7 +139,7 @@ class RequestContext(context.RequestContext):
return self._clients return self._clients
def to_dict(self): def to_dict(self):
user_idt = u'{user} {project}'.format(user=self.user_id or '-', user_idt = '{user} {project}'.format(user=self.user_id or '-',
project=self.project_id or '-') project=self.project_id or '-')
return {'auth_token': self.auth_token, return {'auth_token': self.auth_token,

View File

@ -44,13 +44,13 @@ class yaml_dumper(_yaml_dumper_base):
return self.represent_dict(data.items()) return self.represent_dict(data.items())
yaml_loader.add_constructor(u'tag:yaml.org,2002:str', yaml_loader.add_constructor('tag:yaml.org,2002:str',
yaml_loader._construct_yaml_str) yaml_loader._construct_yaml_str)
# Unquoted dates like 2013-05-23 in yaml files get loaded as objects of type # Unquoted dates like 2013-05-23 in yaml files get loaded as objects of type
# datetime.data which causes problems in API layer when being processed by # datetime.data which causes problems in API layer when being processed by
# openstack.common.jsonutils. Therefore, make unicode string out of timestamps # openstack.common.jsonutils. Therefore, make unicode string out of timestamps
# until jsonutils can handle dates. # until jsonutils can handle dates.
yaml_loader.add_constructor(u'tag:yaml.org,2002:timestamp', yaml_loader.add_constructor('tag:yaml.org,2002:timestamp',
yaml_loader._construct_yaml_str) yaml_loader._construct_yaml_str)
yaml_dumper.add_representer(collections.OrderedDict, yaml_dumper.add_representer(collections.OrderedDict,

View File

@ -109,7 +109,7 @@ class CheckResource(object):
self.retrigger_check_resource(cnxt, rsrc_id, latest_stack) self.retrigger_check_resource(cnxt, rsrc_id, latest_stack)
def _handle_stack_timeout(self, cnxt, stack): def _handle_stack_timeout(self, cnxt, stack):
failure_reason = u'Timed out' failure_reason = 'Timed out'
stack.mark_failed(failure_reason) stack.mark_failed(failure_reason)
def _handle_resource_replacement(self, cnxt, def _handle_resource_replacement(self, cnxt,
@ -179,7 +179,7 @@ class CheckResource(object):
stack, reason) stack, reason)
except scheduler.Timeout: except scheduler.Timeout:
self._handle_resource_failure(cnxt, is_update, rsrc.id, self._handle_resource_failure(cnxt, is_update, rsrc.id,
stack, u'Timed out') stack, 'Timed out')
except CancelOperation: except CancelOperation:
# Stack is already marked FAILED, so we just need to retrigger # Stack is already marked FAILED, so we just need to retrigger
# in case a new traversal has started and is waiting on us. # in case a new traversal has started and is waiting on us.

View File

@ -294,7 +294,7 @@ class Constraint(collections.abc.Mapping):
yield self.description yield self.description
yield self._str() yield self._str()
return u'\n'.join(desc()) return '\n'.join(desc())
def validate(self, value, schema=None, context=None): def validate(self, value, schema=None, context=None):
if not self._is_valid(value, schema, context): if not self._is_valid(value, schema, context):

View File

@ -446,7 +446,7 @@ class InstanceGroup(stack_resource.StackResource):
""" """
if name == self.INSTANCE_LIST: if name == self.INSTANCE_LIST:
def listify(ips): def listify(ips):
return u','.join(ips) or None return ','.join(ips) or None
try: try:
output = self.get_output(name) output = self.get_output(name)

View File

@ -72,7 +72,7 @@ def update_input_data(context, entity_id, current_traversal,
def str_pack_tuple(t): def str_pack_tuple(t):
return u'tuple:' + str(tuple(t)) return 'tuple:' + str(tuple(t))
def _str_unpack_tuple(s): def _str_unpack_tuple(s):
@ -83,7 +83,7 @@ def _str_unpack_tuple(s):
def _deserialize(d): def _deserialize(d):
d2 = {} d2 = {}
for k, v in d.items(): for k, v in d.items():
if isinstance(k, str) and k.startswith(u'tuple:('): if isinstance(k, str) and k.startswith('tuple:('):
k = _str_unpack_tuple(k) k = _str_unpack_tuple(k)
if isinstance(v, dict): if isinstance(v, dict):
v = _deserialize(v) v = _deserialize(v)

View File

@ -59,7 +59,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
copyright = u'2015, Heat Developers' copyright = '2015, Heat Developers'
# Release notes are version independent, no need to set version and release # Release notes are version independent, no need to set version and release
release = '' release = ''
@ -191,8 +191,8 @@ htmlhelp_basename = 'HeatReleaseNotesdoc'
# (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', 'HeatReleaseNotes.tex', u'Heat Release Notes Documentation', ('index', 'HeatReleaseNotes.tex', 'Heat Release Notes Documentation',
u'Heat Developers', 'manual'), 'Heat Developers', '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', 'heatreleasenotes', u'Heat Release Notes Documentation', ('index', 'heatreleasenotes', 'Heat Release Notes Documentation',
[u'Heat Developers'], 1) ['Heat Developers'], 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', 'HeatReleaseNotes', u'Heat Release Notes Documentation', ('index', 'HeatReleaseNotes', 'Heat Release Notes Documentation',
u'Heat Developers', 'HeatReleaseNotes', 'Heat Developers', 'HeatReleaseNotes',
'One line description of project.', 'One line description of project.',
'Miscellaneous'), 'Miscellaneous'),
] ]