Mock Version: 5.0 Mock Version: 5.0 Mock Version: 5.0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --nodeps /builddir/build/SPECS/python-gnocchiclient.spec'], chrootPath='/var/lib/mock/f40-build-2059167-49153/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --noclean --target noarch --nodeps /builddir/build/SPECS/python-gnocchiclient.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1698192000 Wrote: /builddir/build/SRPMS/python-gnocchiclient-7.0.8-1.fc40.src.rpm Child return code was: 0 ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-gnocchiclient.spec'], chrootPath='/var/lib/mock/f40-build-2059167-49153/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-gnocchiclient.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1698192000 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.CUHbUw + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf gnocchiclient-7.0.8 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/gnocchiclient-7.0.8.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd gnocchiclient-7.0.8 + rm -rf /builddir/build/BUILD/gnocchiclient-7.0.8-SPECPARTS + /usr/bin/mkdir -p /builddir/build/BUILD/gnocchiclient-7.0.8-SPECPARTS + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + 2to3 --write --nobackups . /usr/bin/2to3:3: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ from lib2to3.main import main RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: No changes to ./setup.py RefactoringTool: Refactored ./doc/source/conf.py RefactoringTool: No changes to ./gnocchiclient/auth.py RefactoringTool: Refactored ./gnocchiclient/benchmark.py RefactoringTool: No changes to ./gnocchiclient/client.py RefactoringTool: No changes to ./gnocchiclient/exceptions.py RefactoringTool: Refactored ./gnocchiclient/gendoc.py RefactoringTool: No changes to ./gnocchiclient/osc.py RefactoringTool: Refactored ./gnocchiclient/shell.py RefactoringTool: Refactored ./gnocchiclient/utils.py RefactoringTool: No changes to ./gnocchiclient/version.py RefactoringTool: No changes to ./gnocchiclient/tests/functional/base.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_aggregates.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_archive_policy.py --- ./doc/source/conf.py (original) +++ ./doc/source/conf.py (refactored) @@ -43,8 +43,8 @@ master_doc = 'index' # General information about the project. -project = u'Gnocchiclient' -copyright = u'%s, The Gnocchi Developers' % datetime.date.today().year +project = 'Gnocchiclient' +copyright = '%s, The Gnocchi Developers' % datetime.date.today().year # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the --- ./gnocchiclient/benchmark.py (original) +++ ./gnocchiclient/benchmark.py (refactored) @@ -37,10 +37,10 @@ def _pickle_method(m): - if m.im_self is None: - return getattr, (m.im_class, m.im_func.func_name) + if m.__self__ is None: + return getattr, (m.__self__.__class__, m.__func__.__name__) else: - return getattr, (m.im_self, m.im_func.func_name) + return getattr, (m.__self__, m.__func__.__name__) six.moves.copyreg.pickle(types.MethodType, _pickle_method) --- ./gnocchiclient/gendoc.py (original) +++ ./gnocchiclient/gendoc.py (refactored) @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import + import fnmatch @@ -24,7 +24,7 @@ class GnocchiAutoDocDirective(sphinxext.AutoprogramCliffDirective): def _load_commands(self): command_pattern = self.options.get('command') - full_cmd_list = shell.GnocchiCommandManager.SHELL_COMMANDS.keys() + full_cmd_list = list(shell.GnocchiCommandManager.SHELL_COMMANDS.keys()) if command_pattern: commands = [x for x in full_cmd_list if fnmatch.fnmatch(x, command_pattern)] --- ./gnocchiclient/shell.py (original) +++ ./gnocchiclient/shell.py (refactored) @@ -86,7 +86,7 @@ } def load_commands(self, namespace): - for name, command_class in self.SHELL_COMMANDS.items(): + for name, command_class in list(self.SHELL_COMMANDS.items()): self.add_command(name, command_class) @@ -199,10 +199,10 @@ else: if 'description' in error: # Gnocchi format - print(error['description']) + print((error['description'])) elif 'error' in error and 'message' in error['error']: # Keystone format - print(error['error']['message']) + print((error['error']['message'])) def configure_logging(self): if self.options.debug: --- ./gnocchiclient/utils.py (original) +++ ./gnocchiclient/utils.py (refactored) @@ -22,14 +22,14 @@ def add_query_argument(cmd, parser, *args, **kwargs): return parser.add_argument( cmd, - help=u"A query to filter resource. " - u"The syntax is a combination of attribute, operator and value. " - u"For example: id=90d58eea-70d7-4294-a49a-170dcdf44c3c would filter " - u"resource with a certain id. More complex queries can be built, " - u"e.g.: not (flavor_id!=\"1\" and memory>=24). " - u"Use \"\" to force data to be interpreted as string. " - u"Supported operators are: not, and, ∧ or, ∨, >=, <=, !=, >, <, =, " - u"==, eq, ne, lt, gt, ge, le, in, like, ≠, ≥, ≤, like, in.", + help="A query to filter resource. " + "The syntax is a combination of attribute, operator and value. " + "For example: id=90d58eea-70d7-4294-a49a-170dcdf44c3c would filter " + "resource with a certain id. More complex queries can be built, " + "e.g.: not (flavor_id!=\"1\" and memory>=24). " + "Use \"\" to force data to be interpreted as string. " + "Supported operators are: not, and, ∧ or, ∨, >=, <=, !=, >, <, =, " + "==, eq, ne, lt, gt, ge, le, in, like, ≠, ≥, ≤, like, in.", *args, **kwargs) @@ -45,15 +45,15 @@ def format_dict_list(li): return "\n".join( "- " + ", ".join("%s: %s" % (k, v) - for k, v in elem.items()) + for k, v in list(elem.items())) for elem in li) def format_dict_dict(value): return "\n".join( "- %s: " % name + " , ".join("%s: %s" % (k, v) - for k, v in elem.items()) - for name, elem in value.items()) + for k, v in list(elem.items())) + for name, elem in list(value.items())) def format_move_dict_to_root(obj, field): @@ -105,7 +105,7 @@ strings.append("&".join( ("%s=%s" % (k, v) for v in map(urllib_parse.quote, - map(six.text_type, values))))) + list(map(six.text_type, values)))))) return "&".join(strings) --- ./gnocchiclient/tests/functional/test_aggregates.py (original) +++ ./gnocchiclient/tests/functional/test_aggregates.py (refactored) @@ -25,9 +25,9 @@ # CREATE A METRIC result = self.gnocchi( - u'metric', params=u"create" - u' -r metric-res1' - u" --archive-policy-name agg-fetch-test metric-name") + 'metric', params="create" + ' -r metric-res1' + " --archive-policy-name agg-fetch-test metric-name") metric1 = json.loads(result) self.assertIsNotNone(metric1["id"]) self.assertEqual("admin", metric1["creator"]) @@ -38,10 +38,10 @@ # CREATE ANOTHER METRIC result = self.gnocchi( - u'metric', params=u"create" - u' -r metric-res2' - u" --archive-policy-name agg-fetch-test" - u" --unit some-unit metric-name") + 'metric', params="create" + ' -r metric-res2' + " --archive-policy-name agg-fetch-test" + " --unit some-unit metric-name") metric2 = json.loads(result) self.assertIsNotNone(metric2["id"]) self.assertEqual("admin", metric2["creator"]) @@ -113,22 +113,22 @@ measures = json.loads(result) self.assertEqual(4, len(measures)) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r1["id"], - 'timestamp': u'2015-03-06T14:33:57+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r1["id"], + 'timestamp': '2015-03-06T14:33:57+00:00', 'value': 45.11}, measures) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r1["id"], - 'timestamp': u'2015-03-06T14:34:12+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r1["id"], + 'timestamp': '2015-03-06T14:34:12+00:00', 'value': 14.0}, measures) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r2["id"], - 'timestamp': u'2015-03-06T14:33:57+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r2["id"], + 'timestamp': '2015-03-06T14:33:57+00:00', 'value': 45.11}, measures) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r2["id"], - 'timestamp': u'2015-03-06T14:34:12+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r2["id"], + 'timestamp': '2015-03-06T14:34:12+00:00', 'value': 14.0}, measures) RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_archive_policy_rule.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_benchmark.py RefactoringTool: No changes to ./gnocchiclient/tests/functional/test_capabilities.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_metric.py --- ./gnocchiclient/tests/functional/test_archive_policy.py (original) +++ ./gnocchiclient/tests/functional/test_archive_policy.py (refactored) @@ -20,17 +20,17 @@ # CREATE apname = str(uuid.uuid4()) result = self.gnocchi( - u'archive-policy', params=u"create %s" - u" --back-window 0" - u" -d granularity:1s,points:86400" % apname) + 'archive-policy', params="create %s" + " --back-window 0" + " -d granularity:1s,points:86400" % apname) policy = json.loads(result) self.assertEqual(apname, policy["name"]) # CREATE FAIL result = self.gnocchi( - u'archive-policy', params=u"create %s" - u" --back-window 0" - u" -d granularity:1s,points:86400" % apname, + 'archive-policy', params="create %s" + " --back-window 0" + " -d granularity:1s,points:86400" % apname, fail_ok=True, merge_stderr=True) self.assertEqual( "Archive policy %s already exists (HTTP 409)\n" % apname, --- ./gnocchiclient/tests/functional/test_archive_policy_rule.py (original) +++ ./gnocchiclient/tests/functional/test_archive_policy_rule.py (refactored) @@ -20,22 +20,22 @@ apname = str(uuid.uuid4()) # Create an archive policy self.gnocchi( - u'archive-policy', params=u"create %s" - u" -d granularity:1s,points:86400" % apname) + 'archive-policy', params="create %s" + " -d granularity:1s,points:86400" % apname) # CREATE result = self.gnocchi( - u'archive-policy-rule', params=u"create test" - u" --archive-policy-name %s" - u" --metric-pattern 'disk.io.*'" % apname) + 'archive-policy-rule', params="create test" + " --archive-policy-name %s" + " --metric-pattern 'disk.io.*'" % apname) policy_rule = json.loads(result) self.assertEqual('test', policy_rule["name"]) # CREATE FAIL result = self.gnocchi( - u'archive-policy-rule', params=u"create test" - u" --archive-policy-name high" - u" --metric-pattern 'disk.io.*'", + 'archive-policy-rule', params="create test" + " --archive-policy-name high" + " --metric-pattern 'disk.io.*'", fail_ok=True, merge_stderr=True) self.assertEqual( "Archive policy rule test already exists (HTTP 409)\n", @@ -56,12 +56,12 @@ # CREATE - RENAME - GET self.gnocchi( - u'archive-policy-rule', params=u"create to_rename" - u" --archive-policy-name %s" - u" --metric-pattern 'disk.io.*'" % apname) + 'archive-policy-rule', params="create to_rename" + " --archive-policy-name %s" + " --metric-pattern 'disk.io.*'" % apname) result = self.gnocchi( - u'archive-policy-rule', params=u'update to_rename' - u' --name renamed') + 'archive-policy-rule', params='update to_rename' + ' --name renamed') policy_rule = json.loads(result) self.assertEqual('renamed', policy_rule["name"]) --- ./gnocchiclient/tests/functional/test_benchmark.py (original) +++ ./gnocchiclient/tests/functional/test_benchmark.py (refactored) @@ -18,7 +18,7 @@ class BenchmarkMetricTest(base.ClientTestBase): def test_benchmark_metric_create_wrong_workers(self): result = self.gnocchi( - u'benchmark', params=u"metric create -n 0", + 'benchmark', params="metric create -n 0", fail_ok=True, merge_stderr=True) self.assertIn("0 must be greater than 0", result) @@ -29,7 +29,7 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'benchmark', params=u"metric create -n 10 -a %s" % apname) + 'benchmark', params="metric create -n 10 -a %s" % apname) result = json.loads(result) self.assertEqual(10, int(result['create executed'])) self.assertLessEqual(int(result['create failures']), 10) @@ -37,7 +37,7 @@ int(result['create executed'])) result = self.gnocchi( - u'benchmark', params=u"metric create -k -n 10 -a %s" % apname) + 'benchmark', params="metric create -k -n 10 -a %s" % apname) result = json.loads(result) self.assertEqual(10, int(result['create executed'])) self.assertLessEqual(int(result['create failures']), 10) @@ -50,11 +50,11 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'metric', params=u"create -a %s" % apname) + 'metric', params="create -a %s" % apname) metric = json.loads(result) result = self.gnocchi( - u'benchmark', params=u"metric show -n 10 %s" % metric['id']) + 'benchmark', params="metric show -n 10 %s" % metric['id']) result = json.loads(result) self.assertEqual(10, int(result['show executed'])) self.assertLessEqual(int(result['show failures']), 10) @@ -66,26 +66,26 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'metric', params=u"create -a %s" % apname) + 'metric', params="create -a %s" % apname) metric = json.loads(result) result = self.gnocchi( - u'benchmark', params=u"measures add -n 10 -b 4 %s" % metric['id']) + 'benchmark', params="measures add -n 10 -b 4 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['push executed'])) self.assertLessEqual(int(result['push failures']), 2) result = self.gnocchi( - u'benchmark', - params=u"measures add -s 2010-01-01 -n 10 -b 4 %s" + 'benchmark', + params="measures add -s 2010-01-01 -n 10 -b 4 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['push executed'])) self.assertLessEqual(int(result['push failures']), 2) result = self.gnocchi( - u'benchmark', - params=u"measures add --wait -s 2010-01-01 -n 10 -b 4 %s" + 'benchmark', + params="measures add --wait -s 2010-01-01 -n 10 -b 4 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['push executed'])) @@ -99,12 +99,12 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'metric', params=u"create -a %s" % apname) + 'metric', params="create -a %s" % apname) metric = json.loads(result) result = self.gnocchi( - u'benchmark', - params=u"measures show -n 2 %s" + 'benchmark', + params="measures show -n 2 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['show executed'])) --- ./gnocchiclient/tests/functional/test_metric.py (original) +++ ./gnocchiclient/tests/functional/test_metric.py (refactored) @@ -28,13 +28,13 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) # Create 2 metrics result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name %s" % apname) + 'metric', params="create" + " --archive-policy-name %s" % apname) metric1 = json.loads(result) result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name %s" % apname) + 'metric', params="create" + " --archive-policy-name %s" % apname) metric2 = json.loads(result) # DELETE @@ -68,11 +68,11 @@ for i in range(1005): c.metric.create({"archive_policy_name": apname}) RefactoringTool: No changes to ./gnocchiclient/tests/functional/test_osc.py RefactoringTool: No changes to ./gnocchiclient/tests/functional/test_others.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_resource.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_resource_type.py - result = self.gnocchi(u'metric', params=u"list") + result = self.gnocchi('metric', params="list") self.assertGreaterEqual(len(json.loads(result)), 1005) - result = self.gnocchi(u'metric', params=u"list" - u" --limit 2") + result = self.gnocchi('metric', params="list" + " --limit 2") self.assertEqual(2, len(json.loads(result))) def test_metric_measures_exhautic_format(self): @@ -83,8 +83,8 @@ # CREATE METRIC metric_name = str(uuid.uuid4()) result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name " + ap_name + " " + metric_name) + 'metric', params="create" + " --archive-policy-name " + ap_name + " " + metric_name) metric = json.loads(result) # MEASURES ADD @@ -108,8 +108,8 @@ # CREATE METRIC metric_name = str(uuid.uuid4()) result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name " + ap_name + " " + metric_name) + 'metric', params="create" + " --archive-policy-name " + ap_name + " " + metric_name) metric = json.loads(result) # MEASURES ADD @@ -145,8 +145,8 @@ # CREATE WITH NAME AND WITHOUT UNIT result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name metric-test some-name") + 'metric', params="create" + " --archive-policy-name metric-test some-name") metric = json.loads(result) self.assertIsNotNone(metric["id"]) self.assertEqual("admin", metric["creator"]) @@ -157,9 +157,9 @@ # CREATE WITH UNIT result = self.gnocchi( - u'metric', params=u"create another-name" - u" --archive-policy-name metric-test" - u" --unit some-unit") + 'metric', params="create another-name" + " --archive-policy-name metric-test" + " --unit some-unit") metric = json.loads(result) self.assertIsNotNone(metric["id"]) self.assertEqual("admin", metric["creator"]) @@ -238,7 +238,7 @@ self.assertEqual([ {'granularity': 3600.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:00:00+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:00:00+00:00')).isoformat(), 'value': 27.555} ], measures) @@ -327,9 +327,9 @@ metric_name = str(uuid.uuid4()) # CREATE result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name metric-test2 -r metric-res %s" - u" --unit some-unit" % metric_name) + 'metric', params="create" + " --archive-policy-name metric-test2 -r metric-res %s" + " --unit some-unit" % metric_name) metric = json.loads(result) self.assertIsNotNone(metric["id"]) self.assertEqual("admin", metric['creator']) @@ -340,8 +340,8 @@ # CREATE FAIL result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name metric-test2 " + 'metric', params="create" + " --archive-policy-name metric-test2 " "-r metric-res %s" % metric_name, fail_ok=True, merge_stderr=True) self.assertEqual( @@ -403,11 +403,11 @@ self.assertEqual([ {'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), - 'value': 43.11}, - {'granularity': 1.0, - 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), + 'value': 43.11}, + {'granularity': 1.0, + 'timestamp': utils.dt_to_localtz( + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0} ], measures) @@ -425,11 +425,11 @@ self.assertEqual([ {'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), - 'value': 43.11}, - {'granularity': 1.0, - 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), + 'value': 43.11}, + {'granularity': 1.0, + 'timestamp': utils.dt_to_localtz( + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0} ], measures) @@ -469,12 +469,12 @@ {'group': 'project_id: None, user_id: None', 'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), 'value': 43.11}, {'group': 'project_id: None, user_id: None', 'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0}, ], measures) @@ -489,11 +489,11 @@ self.assertEqual([ {'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), - 'value': 43.11}, - {'granularity': 1.0, - 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), + 'value': 43.11}, + {'granularity': 1.0, + 'timestamp': utils.dt_to_localtz( + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0}, ], measures) --- ./gnocchiclient/tests/functional/test_resource.py (original) +++ ./gnocchiclient/tests/functional/test_resource.py (refactored) @@ -29,12 +29,12 @@ apname = str(uuid.uuid4()) # Create an archive policy self.gnocchi( - u'archive-policy', params=u"create %s" - u" -d granularity:1s,points:86400" % apname) + 'archive-policy', params="create %s" + " -d granularity:1s,points:86400" % apname) # CREATE result = self.gnocchi( - u'resource', params=u"create %s --type generic" % + 'resource', params="create %s --type generic" % self.RESOURCE_ID) resource = json.loads(result) self.assertEqual(self.RESOURCE_ID, resource["id"]) @@ -170,10 +170,10 @@ # Create and Batch Delete result1 = self.gnocchi( - u'resource', params=u"create %s --type generic" % + 'resource', params="create %s --type generic" % self.RESOURCE_ID) result2 = self.gnocchi( - u'resource', params=u"create %s --type generic" % + 'resource', params="create %s --type generic" % self.RESOURCE_ID2) resource1 = json.loads(result1) resource2 = json.loads(result2) --- ./gnocchiclient/tests/functional/test_resource_type.py (original) +++ ./gnocchiclient/tests/functional/test_resource_type.py (refactored) @@ -30,8 +30,8 @@ # CREATE result = self.gnocchi( - u'resource-type', - params=u"create -a foo:string:true:max_length=16 " + 'resource-type', + params="create -a foo:string:true:max_length=16 " "-a bar:number:no:max=32 %s" % self.RESOURCE_TYPE) resource = json.loads(result) RefactoringTool: No changes to ./gnocchiclient/tests/unit/test_auth.py RefactoringTool: No changes to ./gnocchiclient/tests/unit/test_exceptions.py RefactoringTool: No changes to ./gnocchiclient/v1/aggregates.py RefactoringTool: No changes to ./gnocchiclient/v1/aggregates_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy_rule.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy_rule_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/base.py RefactoringTool: No changes to ./gnocchiclient/v1/build.py RefactoringTool: No changes to ./gnocchiclient/v1/build_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/capabilities.py RefactoringTool: No changes to ./gnocchiclient/v1/capabilities_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/client.py RefactoringTool: No changes to ./gnocchiclient/v1/metric.py RefactoringTool: No changes to ./gnocchiclient/v1/metric_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/resource.py RefactoringTool: Refactored ./gnocchiclient/v1/resource_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/resource_type.py RefactoringTool: Refactored ./gnocchiclient/v1/resource_type_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/status.py RefactoringTool: No changes to ./gnocchiclient/v1/status_cli.py RefactoringTool: Files that were modified: RefactoringTool: ./setup.py RefactoringTool: ./doc/source/conf.py RefactoringTool: ./gnocchiclient/auth.py RefactoringTool: ./gnocchiclient/benchmark.py RefactoringTool: ./gnocchiclient/client.py RefactoringTool: ./gnocchiclient/exceptions.py RefactoringTool: ./gnocchiclient/gendoc.py RefactoringTool: ./gnocchiclient/osc.py RefactoringTool: ./gnocchiclient/shell.py RefactoringTool: ./gnocchiclient/utils.py RefactoringTool: ./gnocchiclient/version.py RefactoringTool: ./gnocchiclient/tests/functional/base.py RefactoringTool: ./gnocchiclient/tests/functional/test_aggregates.py RefactoringTool: ./gnocchiclient/tests/functional/test_archive_policy.py RefactoringTool: ./gnocchiclient/tests/functional/test_archive_policy_rule.py RefactoringTool: ./gnocchiclient/tests/functional/test_benchmark.py RefactoringTool: ./gnocchiclient/tests/functional/test_capabilities.py RefactoringTool: ./gnocchiclient/tests/functional/test_metric.py RefactoringTool: ./gnocchiclient/tests/functional/test_osc.py RefactoringTool: ./gnocchiclient/tests/functional/test_others.py RefactoringTool: ./gnocchiclient/tests/functional/test_resource.py RefactoringTool: ./gnocchiclient/tests/functional/test_resource_type.py RefactoringTool: ./gnocchiclient/tests/unit/test_auth.py RefactoringTool: ./gnocchiclient/tests/unit/test_exceptions.py RefactoringTool: ./gnocchiclient/v1/aggregates.py RefactoringTool: ./gnocchiclient/v1/aggregates_cli.py RefactoringTool: ./gnocchiclient/v1/archive_policy.py RefactoringTool: ./gnocchiclient/v1/archive_policy_cli.py RefactoringTool: ./gnocchiclient/v1/archive_policy_rule.py RefactoringTool: ./gnocchiclient/v1/archive_policy_rule_cli.py RefactoringTool: ./gnocchiclient/v1/base.py RefactoringTool: ./gnocchiclient/v1/build.py RefactoringTool: ./gnocchiclient/v1/build_cli.py RefactoringTool: ./gnocchiclient/v1/capabilities.py RefactoringTool: ./gnocchiclient/v1/capabilities_cli.py RefactoringTool: ./gnocchiclient/v1/client.py RefactoringTool: ./gnocchiclient/v1/metric.py RefactoringTool: ./gnocchiclient/v1/metric_cli.py RefactoringTool: ./gnocchiclient/v1/resource.py RefactoringTool: ./gnocchiclient/v1/resource_cli.py RefactoringTool: ./gnocchiclient/v1/resource_type.py RefactoringTool: ./gnocchiclient/v1/resource_type_cli.py RefactoringTool: ./gnocchiclient/v1/status.py RefactoringTool: ./gnocchiclient/v1/status_cli.py self.assertEqual(self.RESOURCE_TYPE, resource["name"]) @@ -41,7 +41,7 @@ # SHOW result = self.gnocchi( - u'resource-type', params=u"show %s" % self.RESOURCE_TYPE) + 'resource-type', params="show %s" % self.RESOURCE_TYPE) resource = json.loads(result) self.assertEqual(self.RESOURCE_TYPE, resource["name"]) self.assertEqual( @@ -50,8 +50,8 @@ # PATCH result = self.gnocchi( - u'resource-type', - params=u"update -r foo " + 'resource-type', + params="update -r foo " "-a new:number:yes:max=16:fill=8 %s" % self.RESOURCE_TYPE) resource = json.loads(result) self.assertEqual(self.RESOURCE_TYPE, resource["name"]) @@ -62,7 +62,7 @@ # SHOW result = self.gnocchi( - u'resource-type', params=u"show %s" % self.RESOURCE_TYPE) + 'resource-type', params="show %s" % self.RESOURCE_TYPE) resource = json.loads(result) self.assertEqual(self.RESOURCE_TYPE, resource["name"]) self.assertNotIn("attributes/foo", resource) @@ -72,7 +72,7 @@ # Create a resource for this type result = self.gnocchi( - u'resource', params=(u"create %s -t %s -a new:5") % + 'resource', params=("create %s -t %s -a new:5") % (self.RESOURCE_ID, self.RESOURCE_TYPE)) resource = json.loads(result) self.assertEqual(self.RESOURCE_ID, resource["id"]) @@ -98,8 +98,8 @@ result) # SHOW AGAIN - result = self.gnocchi(u'resource-type', - params=u"show %s" % self.RESOURCE_TYPE, + result = self.gnocchi('resource-type', + params="show %s" % self.RESOURCE_TYPE, fail_ok=True, merge_stderr=True) self.assertEqual( "Resource type %s does not exist (HTTP 404)\n" --- ./gnocchiclient/v1/resource_cli.py (original) +++ ./gnocchiclient/v1/resource_cli.py (refactored) @@ -115,7 +115,7 @@ def normalize_metrics(res): res['metrics'] = "\n".join(sorted( ["%s: %s" % (name, _id) - for name, _id in res['metrics'].items()])) + for name, _id in list(res['metrics'].items())])) return res --- ./gnocchiclient/v1/resource_type_cli.py (original) +++ ./gnocchiclient/v1/resource_type_cli.py (refactored) @@ -42,14 +42,14 @@ parser.add_argument("-a", "--attribute", action='append', type=self._resource_attribute, default=[], - help=(u"attribute definition, " - u"attribute_name:" - u"attribute_type:" - u"attribute_is_required:" - u"attribute_type_option_name=" - u"attribute_type_option_value:... " - u"For example: " - u"display_name:string:true:max_length=255")) + help=("attribute definition, " + "attribute_name:" + "attribute_type:" + "attribute_is_required:" + "attribute_type_option_name=" + "attribute_type_option_value:... " + "For example: " + "display_name:string:true:max_length=255")) return parser @classmethod @@ -90,7 +90,7 @@ parser = super(CliResourceTypeUpdate, self).get_parser(prog_name) parser.add_argument("-r", "--remove-attribute", action='append', default=[], - help=u"attribute name") + help="attribute name") return parser + sed -i '/^[[:space:]]*-c{env:.*_CONSTRAINTS_FILE.*/d' tox.ini + sed -i 's/^deps = -c{env:.*_CONSTRAINTS_FILE.*/deps =/' tox.ini + sed -i '/^minversion.*/d' tox.ini + sed -i '/^requires.*virtualenv.*/d' tox.ini + sed -i '/\.\[test,openstack\]/,+2d' tox.ini + sed -i '/\.*\[testenv\]deps/,+1d' tox.ini + sed -i '/\.\[test,doc\]/d' tox.ini + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.ifnYCf + umask 022 + cd /builddir/build/BUILD + cd gnocchiclient-7.0.8 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo '(python3dist(tomli) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/gnocchiclient-7.0.8/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/gnocchiclient-7.0.8/.pyproject-builddir + RPM_TOXENV=py312 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/gnocchiclient-7.0.8/pyproject-wheeldir --output /builddir/build/BUILD/python-gnocchiclient-7.0.8-1.fc40.noarch-pyproject-buildrequires -t -e py312 Handling setuptools from build-system.requires Requirement not satisfied: setuptools Handling setuptools_scm from build-system.requires Requirement not satisfied: setuptools_scm Handling wheel from build-system.requires Requirement not satisfied: wheel Exiting dependency generation pass: build backend + cat /builddir/build/BUILD/python-gnocchiclient-7.0.8-1.fc40.noarch-pyproject-buildrequires + rm -rfv '*.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-gnocchiclient-7.0.8-1.fc40.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-gnocchiclient.spec'], chrootPath='/var/lib/mock/f40-build-2059167-49153/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-gnocchiclient.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1698192000 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.J9nZg8 + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf gnocchiclient-7.0.8 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/gnocchiclient-7.0.8.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd gnocchiclient-7.0.8 + rm -rf /builddir/build/BUILD/gnocchiclient-7.0.8-SPECPARTS + /usr/bin/mkdir -p /builddir/build/BUILD/gnocchiclient-7.0.8-SPECPARTS + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + 2to3 --write --nobackups . /usr/bin/2to3:3: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ from lib2to3.main import main RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: No changes to ./setup.py RefactoringTool: Refactored ./doc/source/conf.py RefactoringTool: No changes to ./gnocchiclient/auth.py RefactoringTool: Refactored ./gnocchiclient/benchmark.py RefactoringTool: No changes to ./gnocchiclient/client.py RefactoringTool: No changes to ./gnocchiclient/exceptions.py RefactoringTool: Refactored ./gnocchiclient/gendoc.py RefactoringTool: No changes to ./gnocchiclient/osc.py RefactoringTool: Refactored ./gnocchiclient/shell.py RefactoringTool: Refactored ./gnocchiclient/utils.py RefactoringTool: No changes to ./gnocchiclient/version.py RefactoringTool: No changes to ./gnocchiclient/tests/functional/base.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_aggregates.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_archive_policy.py --- ./doc/source/conf.py (original) +++ ./doc/source/conf.py (refactored) @@ -43,8 +43,8 @@ master_doc = 'index' # General information about the project. -project = u'Gnocchiclient' -copyright = u'%s, The Gnocchi Developers' % datetime.date.today().year +project = 'Gnocchiclient' +copyright = '%s, The Gnocchi Developers' % datetime.date.today().year # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the --- ./gnocchiclient/benchmark.py (original) +++ ./gnocchiclient/benchmark.py (refactored) @@ -37,10 +37,10 @@ def _pickle_method(m): - if m.im_self is None: - return getattr, (m.im_class, m.im_func.func_name) + if m.__self__ is None: + return getattr, (m.__self__.__class__, m.__func__.__name__) else: - return getattr, (m.im_self, m.im_func.func_name) + return getattr, (m.__self__, m.__func__.__name__) six.moves.copyreg.pickle(types.MethodType, _pickle_method) --- ./gnocchiclient/gendoc.py (original) +++ ./gnocchiclient/gendoc.py (refactored) @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import + import fnmatch @@ -24,7 +24,7 @@ class GnocchiAutoDocDirective(sphinxext.AutoprogramCliffDirective): def _load_commands(self): command_pattern = self.options.get('command') - full_cmd_list = shell.GnocchiCommandManager.SHELL_COMMANDS.keys() + full_cmd_list = list(shell.GnocchiCommandManager.SHELL_COMMANDS.keys()) if command_pattern: commands = [x for x in full_cmd_list if fnmatch.fnmatch(x, command_pattern)] --- ./gnocchiclient/shell.py (original) +++ ./gnocchiclient/shell.py (refactored) @@ -86,7 +86,7 @@ } def load_commands(self, namespace): - for name, command_class in self.SHELL_COMMANDS.items(): + for name, command_class in list(self.SHELL_COMMANDS.items()): self.add_command(name, command_class) @@ -199,10 +199,10 @@ else: if 'description' in error: # Gnocchi format - print(error['description']) + print((error['description'])) elif 'error' in error and 'message' in error['error']: # Keystone format - print(error['error']['message']) + print((error['error']['message'])) def configure_logging(self): if self.options.debug: --- ./gnocchiclient/utils.py (original) +++ ./gnocchiclient/utils.py (refactored) @@ -22,14 +22,14 @@ def add_query_argument(cmd, parser, *args, **kwargs): return parser.add_argument( cmd, - help=u"A query to filter resource. " - u"The syntax is a combination of attribute, operator and value. " - u"For example: id=90d58eea-70d7-4294-a49a-170dcdf44c3c would filter " - u"resource with a certain id. More complex queries can be built, " - u"e.g.: not (flavor_id!=\"1\" and memory>=24). " - u"Use \"\" to force data to be interpreted as string. " - u"Supported operators are: not, and, ∧ or, ∨, >=, <=, !=, >, <, =, " - u"==, eq, ne, lt, gt, ge, le, in, like, ≠, ≥, ≤, like, in.", + help="A query to filter resource. " + "The syntax is a combination of attribute, operator and value. " + "For example: id=90d58eea-70d7-4294-a49a-170dcdf44c3c would filter " + "resource with a certain id. More complex queries can be built, " + "e.g.: not (flavor_id!=\"1\" and memory>=24). " + "Use \"\" to force data to be interpreted as string. " + "Supported operators are: not, and, ∧ or, ∨, >=, <=, !=, >, <, =, " + "==, eq, ne, lt, gt, ge, le, in, like, ≠, ≥, ≤, like, in.", *args, **kwargs) @@ -45,15 +45,15 @@ def format_dict_list(li): return "\n".join( "- " + ", ".join("%s: %s" % (k, v) - for k, v in elem.items()) + for k, v in list(elem.items())) for elem in li) def format_dict_dict(value): return "\n".join( "- %s: " % name + " , ".join("%s: %s" % (k, v) - for k, v in elem.items()) - for name, elem in value.items()) + for k, v in list(elem.items())) + for name, elem in list(value.items())) def format_move_dict_to_root(obj, field): @@ -105,7 +105,7 @@ strings.append("&".join( ("%s=%s" % (k, v) for v in map(urllib_parse.quote, - map(six.text_type, values))))) + list(map(six.text_type, values)))))) return "&".join(strings) --- ./gnocchiclient/tests/functional/test_aggregates.py (original) +++ ./gnocchiclient/tests/functional/test_aggregates.py (refactored) @@ -25,9 +25,9 @@ # CREATE A METRIC result = self.gnocchi( - u'metric', params=u"create" - u' -r metric-res1' - u" --archive-policy-name agg-fetch-test metric-name") + 'metric', params="create" + ' -r metric-res1' + " --archive-policy-name agg-fetch-test metric-name") metric1 = json.loads(result) self.assertIsNotNone(metric1["id"]) self.assertEqual("admin", metric1["creator"]) @@ -38,10 +38,10 @@ # CREATE ANOTHER METRIC result = self.gnocchi( - u'metric', params=u"create" - u' -r metric-res2' - u" --archive-policy-name agg-fetch-test" - u" --unit some-unit metric-name") + 'metric', params="create" + ' -r metric-res2' + " --archive-policy-name agg-fetch-test" + " --unit some-unit metric-name") metric2 = json.loads(result) self.assertIsNotNone(metric2["id"]) self.assertEqual("admin", metric2["creator"]) @@ -113,22 +113,22 @@ measures = json.loads(result) self.assertEqual(4, len(measures)) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r1["id"], - 'timestamp': u'2015-03-06T14:33:57+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r1["id"], + 'timestamp': '2015-03-06T14:33:57+00:00', 'value': 45.11}, measures) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r1["id"], - 'timestamp': u'2015-03-06T14:34:12+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r1["id"], + 'timestamp': '2015-03-06T14:34:12+00:00', 'value': 14.0}, measures) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r2["id"], - 'timestamp': u'2015-03-06T14:33:57+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r2["id"], + 'timestamp': '2015-03-06T14:33:57+00:00', 'value': 45.11}, measures) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r2["id"], - 'timestamp': u'2015-03-06T14:34:12+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r2["id"], + 'timestamp': '2015-03-06T14:34:12+00:00', 'value': 14.0}, measures) RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_archive_policy_rule.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_benchmark.py RefactoringTool: No changes to ./gnocchiclient/tests/functional/test_capabilities.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_metric.py --- ./gnocchiclient/tests/functional/test_archive_policy.py (original) +++ ./gnocchiclient/tests/functional/test_archive_policy.py (refactored) @@ -20,17 +20,17 @@ # CREATE apname = str(uuid.uuid4()) result = self.gnocchi( - u'archive-policy', params=u"create %s" - u" --back-window 0" - u" -d granularity:1s,points:86400" % apname) + 'archive-policy', params="create %s" + " --back-window 0" + " -d granularity:1s,points:86400" % apname) policy = json.loads(result) self.assertEqual(apname, policy["name"]) # CREATE FAIL result = self.gnocchi( - u'archive-policy', params=u"create %s" - u" --back-window 0" - u" -d granularity:1s,points:86400" % apname, + 'archive-policy', params="create %s" + " --back-window 0" + " -d granularity:1s,points:86400" % apname, fail_ok=True, merge_stderr=True) self.assertEqual( "Archive policy %s already exists (HTTP 409)\n" % apname, --- ./gnocchiclient/tests/functional/test_archive_policy_rule.py (original) +++ ./gnocchiclient/tests/functional/test_archive_policy_rule.py (refactored) @@ -20,22 +20,22 @@ apname = str(uuid.uuid4()) # Create an archive policy self.gnocchi( - u'archive-policy', params=u"create %s" - u" -d granularity:1s,points:86400" % apname) + 'archive-policy', params="create %s" + " -d granularity:1s,points:86400" % apname) # CREATE result = self.gnocchi( - u'archive-policy-rule', params=u"create test" - u" --archive-policy-name %s" - u" --metric-pattern 'disk.io.*'" % apname) + 'archive-policy-rule', params="create test" + " --archive-policy-name %s" + " --metric-pattern 'disk.io.*'" % apname) policy_rule = json.loads(result) self.assertEqual('test', policy_rule["name"]) # CREATE FAIL result = self.gnocchi( - u'archive-policy-rule', params=u"create test" - u" --archive-policy-name high" - u" --metric-pattern 'disk.io.*'", + 'archive-policy-rule', params="create test" + " --archive-policy-name high" + " --metric-pattern 'disk.io.*'", fail_ok=True, merge_stderr=True) self.assertEqual( "Archive policy rule test already exists (HTTP 409)\n", @@ -56,12 +56,12 @@ # CREATE - RENAME - GET self.gnocchi( - u'archive-policy-rule', params=u"create to_rename" - u" --archive-policy-name %s" - u" --metric-pattern 'disk.io.*'" % apname) + 'archive-policy-rule', params="create to_rename" + " --archive-policy-name %s" + " --metric-pattern 'disk.io.*'" % apname) result = self.gnocchi( - u'archive-policy-rule', params=u'update to_rename' - u' --name renamed') + 'archive-policy-rule', params='update to_rename' + ' --name renamed') policy_rule = json.loads(result) self.assertEqual('renamed', policy_rule["name"]) --- ./gnocchiclient/tests/functional/test_benchmark.py (original) +++ ./gnocchiclient/tests/functional/test_benchmark.py (refactored) @@ -18,7 +18,7 @@ class BenchmarkMetricTest(base.ClientTestBase): def test_benchmark_metric_create_wrong_workers(self): result = self.gnocchi( - u'benchmark', params=u"metric create -n 0", + 'benchmark', params="metric create -n 0", fail_ok=True, merge_stderr=True) self.assertIn("0 must be greater than 0", result) @@ -29,7 +29,7 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'benchmark', params=u"metric create -n 10 -a %s" % apname) + 'benchmark', params="metric create -n 10 -a %s" % apname) result = json.loads(result) self.assertEqual(10, int(result['create executed'])) self.assertLessEqual(int(result['create failures']), 10) @@ -37,7 +37,7 @@ int(result['create executed'])) result = self.gnocchi( - u'benchmark', params=u"metric create -k -n 10 -a %s" % apname) + 'benchmark', params="metric create -k -n 10 -a %s" % apname) result = json.loads(result) self.assertEqual(10, int(result['create executed'])) self.assertLessEqual(int(result['create failures']), 10) @@ -50,11 +50,11 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'metric', params=u"create -a %s" % apname) + 'metric', params="create -a %s" % apname) metric = json.loads(result) result = self.gnocchi( - u'benchmark', params=u"metric show -n 10 %s" % metric['id']) + 'benchmark', params="metric show -n 10 %s" % metric['id']) result = json.loads(result) self.assertEqual(10, int(result['show executed'])) self.assertLessEqual(int(result['show failures']), 10) @@ -66,26 +66,26 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'metric', params=u"create -a %s" % apname) + 'metric', params="create -a %s" % apname) metric = json.loads(result) result = self.gnocchi( - u'benchmark', params=u"measures add -n 10 -b 4 %s" % metric['id']) + 'benchmark', params="measures add -n 10 -b 4 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['push executed'])) self.assertLessEqual(int(result['push failures']), 2) result = self.gnocchi( - u'benchmark', - params=u"measures add -s 2010-01-01 -n 10 -b 4 %s" + 'benchmark', + params="measures add -s 2010-01-01 -n 10 -b 4 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['push executed'])) self.assertLessEqual(int(result['push failures']), 2) result = self.gnocchi( - u'benchmark', - params=u"measures add --wait -s 2010-01-01 -n 10 -b 4 %s" + 'benchmark', + params="measures add --wait -s 2010-01-01 -n 10 -b 4 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['push executed'])) @@ -99,12 +99,12 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'metric', params=u"create -a %s" % apname) + 'metric', params="create -a %s" % apname) metric = json.loads(result) result = self.gnocchi( - u'benchmark', - params=u"measures show -n 2 %s" + 'benchmark', + params="measures show -n 2 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['show executed'])) --- ./gnocchiclient/tests/functional/test_metric.py (original) +++ ./gnocchiclient/tests/functional/test_metric.py (refactored) @@ -28,13 +28,13 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) # Create 2 metrics result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name %s" % apname) + 'metric', params="create" + " --archive-policy-name %s" % apname) metric1 = json.loads(result) result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name %s" % apname) + 'metric', params="create" + " --archive-policy-name %s" % apname) metric2 = json.loads(result) # DELETE @@ -68,11 +68,11 @@ for i in range(1005): c.metric.create({"archive_policy_name": apname}) RefactoringTool: No changes to ./gnocchiclient/tests/functional/test_osc.py RefactoringTool: No changes to ./gnocchiclient/tests/functional/test_others.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_resource.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_resource_type.py - result = self.gnocchi(u'metric', params=u"list") + result = self.gnocchi('metric', params="list") self.assertGreaterEqual(len(json.loads(result)), 1005) - result = self.gnocchi(u'metric', params=u"list" - u" --limit 2") + result = self.gnocchi('metric', params="list" + " --limit 2") self.assertEqual(2, len(json.loads(result))) def test_metric_measures_exhautic_format(self): @@ -83,8 +83,8 @@ # CREATE METRIC metric_name = str(uuid.uuid4()) result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name " + ap_name + " " + metric_name) + 'metric', params="create" + " --archive-policy-name " + ap_name + " " + metric_name) metric = json.loads(result) # MEASURES ADD @@ -108,8 +108,8 @@ # CREATE METRIC metric_name = str(uuid.uuid4()) result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name " + ap_name + " " + metric_name) + 'metric', params="create" + " --archive-policy-name " + ap_name + " " + metric_name) metric = json.loads(result) # MEASURES ADD @@ -145,8 +145,8 @@ # CREATE WITH NAME AND WITHOUT UNIT result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name metric-test some-name") + 'metric', params="create" + " --archive-policy-name metric-test some-name") metric = json.loads(result) self.assertIsNotNone(metric["id"]) self.assertEqual("admin", metric["creator"]) @@ -157,9 +157,9 @@ # CREATE WITH UNIT result = self.gnocchi( - u'metric', params=u"create another-name" - u" --archive-policy-name metric-test" - u" --unit some-unit") + 'metric', params="create another-name" + " --archive-policy-name metric-test" + " --unit some-unit") metric = json.loads(result) self.assertIsNotNone(metric["id"]) self.assertEqual("admin", metric["creator"]) @@ -238,7 +238,7 @@ self.assertEqual([ {'granularity': 3600.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:00:00+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:00:00+00:00')).isoformat(), 'value': 27.555} ], measures) @@ -327,9 +327,9 @@ metric_name = str(uuid.uuid4()) # CREATE result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name metric-test2 -r metric-res %s" - u" --unit some-unit" % metric_name) + 'metric', params="create" + " --archive-policy-name metric-test2 -r metric-res %s" + " --unit some-unit" % metric_name) metric = json.loads(result) self.assertIsNotNone(metric["id"]) self.assertEqual("admin", metric['creator']) @@ -340,8 +340,8 @@ # CREATE FAIL result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name metric-test2 " + 'metric', params="create" + " --archive-policy-name metric-test2 " "-r metric-res %s" % metric_name, fail_ok=True, merge_stderr=True) self.assertEqual( @@ -403,11 +403,11 @@ self.assertEqual([ {'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), - 'value': 43.11}, - {'granularity': 1.0, - 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), + 'value': 43.11}, + {'granularity': 1.0, + 'timestamp': utils.dt_to_localtz( + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0} ], measures) @@ -425,11 +425,11 @@ self.assertEqual([ {'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), - 'value': 43.11}, - {'granularity': 1.0, - 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), + 'value': 43.11}, + {'granularity': 1.0, + 'timestamp': utils.dt_to_localtz( + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0} ], measures) @@ -469,12 +469,12 @@ {'group': 'project_id: None, user_id: None', 'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), 'value': 43.11}, {'group': 'project_id: None, user_id: None', 'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0}, ], measures) @@ -489,11 +489,11 @@ self.assertEqual([ {'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), - 'value': 43.11}, - {'granularity': 1.0, - 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), + 'value': 43.11}, + {'granularity': 1.0, + 'timestamp': utils.dt_to_localtz( + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0}, ], measures) --- ./gnocchiclient/tests/functional/test_resource.py (original) +++ ./gnocchiclient/tests/functional/test_resource.py (refactored) @@ -29,12 +29,12 @@ apname = str(uuid.uuid4()) # Create an archive policy self.gnocchi( - u'archive-policy', params=u"create %s" - u" -d granularity:1s,points:86400" % apname) + 'archive-policy', params="create %s" + " -d granularity:1s,points:86400" % apname) # CREATE result = self.gnocchi( - u'resource', params=u"create %s --type generic" % + 'resource', params="create %s --type generic" % self.RESOURCE_ID) resource = json.loads(result) self.assertEqual(self.RESOURCE_ID, resource["id"]) @@ -170,10 +170,10 @@ # Create and Batch Delete result1 = self.gnocchi( - u'resource', params=u"create %s --type generic" % + 'resource', params="create %s --type generic" % self.RESOURCE_ID) result2 = self.gnocchi( - u'resource', params=u"create %s --type generic" % + 'resource', params="create %s --type generic" % self.RESOURCE_ID2) resource1 = json.loads(result1) resource2 = json.loads(result2) --- ./gnocchiclient/tests/functional/test_resource_type.py (original) +++ ./gnocchiclient/tests/functional/test_resource_type.py (refactored) @@ -30,8 +30,8 @@ # CREATE result = self.gnocchi( - u'resource-type', - params=u"create -a foo:string:true:max_length=16 " + 'resource-type', + params="create -a foo:string:true:max_length=16 " "-a bar:number:no:max=32 %s" % self.RESOURCE_TYPE) resource = json.loads(result) RefactoringTool: No changes to ./gnocchiclient/tests/unit/test_auth.py RefactoringTool: No changes to ./gnocchiclient/tests/unit/test_exceptions.py RefactoringTool: No changes to ./gnocchiclient/v1/aggregates.py RefactoringTool: No changes to ./gnocchiclient/v1/aggregates_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy_rule.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy_rule_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/base.py RefactoringTool: No changes to ./gnocchiclient/v1/build.py RefactoringTool: No changes to ./gnocchiclient/v1/build_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/capabilities.py RefactoringTool: No changes to ./gnocchiclient/v1/capabilities_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/client.py RefactoringTool: No changes to ./gnocchiclient/v1/metric.py RefactoringTool: No changes to ./gnocchiclient/v1/metric_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/resource.py RefactoringTool: Refactored ./gnocchiclient/v1/resource_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/resource_type.py RefactoringTool: Refactored ./gnocchiclient/v1/resource_type_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/status.py RefactoringTool: No changes to ./gnocchiclient/v1/status_cli.py RefactoringTool: Files that were modified: RefactoringTool: ./setup.py RefactoringTool: ./doc/source/conf.py RefactoringTool: ./gnocchiclient/auth.py RefactoringTool: ./gnocchiclient/benchmark.py RefactoringTool: ./gnocchiclient/client.py RefactoringTool: ./gnocchiclient/exceptions.py RefactoringTool: ./gnocchiclient/gendoc.py RefactoringTool: ./gnocchiclient/osc.py RefactoringTool: ./gnocchiclient/shell.py RefactoringTool: ./gnocchiclient/utils.py RefactoringTool: ./gnocchiclient/version.py RefactoringTool: ./gnocchiclient/tests/functional/base.py RefactoringTool: ./gnocchiclient/tests/functional/test_aggregates.py RefactoringTool: ./gnocchiclient/tests/functional/test_archive_policy.py RefactoringTool: ./gnocchiclient/tests/functional/test_archive_policy_rule.py RefactoringTool: ./gnocchiclient/tests/functional/test_benchmark.py RefactoringTool: ./gnocchiclient/tests/functional/test_capabilities.py RefactoringTool: ./gnocchiclient/tests/functional/test_metric.py RefactoringTool: ./gnocchiclient/tests/functional/test_osc.py RefactoringTool: ./gnocchiclient/tests/functional/test_others.py RefactoringTool: ./gnocchiclient/tests/functional/test_resource.py RefactoringTool: ./gnocchiclient/tests/functional/test_resource_type.py RefactoringTool: ./gnocchiclient/tests/unit/test_auth.py RefactoringTool: ./gnocchiclient/tests/unit/test_exceptions.py RefactoringTool: ./gnocchiclient/v1/aggregates.py RefactoringTool: ./gnocchiclient/v1/aggregates_cli.py RefactoringTool: ./gnocchiclient/v1/archive_policy.py RefactoringTool: ./gnocchiclient/v1/archive_policy_cli.py RefactoringTool: ./gnocchiclient/v1/archive_policy_rule.py RefactoringTool: ./gnocchiclient/v1/archive_policy_rule_cli.py RefactoringTool: ./gnocchiclient/v1/base.py RefactoringTool: ./gnocchiclient/v1/build.py RefactoringTool: ./gnocchiclient/v1/build_cli.py RefactoringTool: ./gnocchiclient/v1/capabilities.py RefactoringTool: ./gnocchiclient/v1/capabilities_cli.py RefactoringTool: ./gnocchiclient/v1/client.py RefactoringTool: ./gnocchiclient/v1/metric.py RefactoringTool: ./gnocchiclient/v1/metric_cli.py RefactoringTool: ./gnocchiclient/v1/resource.py self.assertEqual(self.RESOURCE_TYPE, resource["name"]) @@ -41,7 +41,7 @@ # SHOW result = self.gnocchi( - u'resource-type', params=u"show %s" % self.RESOURCE_TYPE) + 'resource-type', params="show %s" % self.RESOURCE_TYPE) resource = json.loads(result) self.assertEqual(self.RESOURCE_TYPE, resource["name"]) self.assertEqual( @@ -50,8 +50,8 @@ # PATCH result = self.gnocchi( - u'resource-type', - params=u"update -r foo " + 'resource-type', + params="update -r foo " "-a new:number:yes:max=16:fill=8 %s" % self.RESOURCE_TYPE) resource = json.loads(result) self.assertEqual(self.RESOURCE_TYPE, resource["name"]) @@ -62,7 +62,7 @@ # SHOW result = self.gnocchi( - u'resource-type', params=u"show %s" % self.RESOURCE_TYPE) + 'resource-type', params="show %s" % self.RESOURCE_TYPE) resource = json.loads(result) self.assertEqual(self.RESOURCE_TYPE, resource["name"]) self.assertNotIn("attributes/foo", resource) @@ -72,7 +72,7 @@ # Create a resource for this type result = self.gnocchi( - u'resource', params=(u"create %s -t %s -a new:5") % + 'resource', params=("create %s -t %s -a new:5") % (self.RESOURCE_ID, self.RESOURCE_TYPE)) resource = json.loads(result) self.assertEqual(self.RESOURCE_ID, resource["id"]) @@ -98,8 +98,8 @@ result) # SHOW AGAIN - result = self.gnocchi(u'resource-type', - params=u"show %s" % self.RESOURCE_TYPE, + result = self.gnocchi('resource-type', + params="show %s" % self.RESOURCE_TYPE, fail_ok=True, merge_stderr=True) self.assertEqual( "Resource type %s does not exist (HTTP 404)\n" --- ./gnocchiclient/v1/resource_cli.py (original) +++ ./gnocchiclient/v1/resource_cli.py (refactored) @@ -115,7 +115,7 @@ def normalize_metrics(res): res['metrics'] = "\n".join(sorted( ["%s: %s" % (name, _id) - for name, _id in res['metrics'].items()])) + for name, _id in list(res['metrics'].items())])) return res --- ./gnocchiclient/v1/resource_type_cli.py (original) +++ ./gnocchiclient/v1/resource_type_cli.py (refactored) @@ -42,14 +42,14 @@ parser.add_argument("-a", "--attribute", action='append', type=self._resource_attribute, default=[], - help=(u"attribute definition, " - u"attribute_name:" - u"attribute_type:" - u"attribute_is_required:" - u"attribute_type_option_name=" - u"attribute_type_option_value:... " - u"For example: " - u"display_name:string:true:max_length=255")) + help=("attribute definition, " + "attribute_name:" + "attribute_type:" + "attribute_is_required:" + "attribute_type_option_name=" + "attribute_type_option_value:... " + "For example: " + "display_name:string:true:max_length=255")) return parser @classmethod @@ -90,7 +90,7 @@ parser = super(CliResourceTypeUpdate, self).get_parser(prog_name) parser.add_argument("-r", "--remove-attribute", action='append', default=[], - help=u"attribute name") + help="attribute name") return parser RefactoringTool: ./gnocchiclient/v1/resource_cli.py RefactoringTool: ./gnocchiclient/v1/resource_type.py RefactoringTool: ./gnocchiclient/v1/resource_type_cli.py RefactoringTool: ./gnocchiclient/v1/status.py RefactoringTool: ./gnocchiclient/v1/status_cli.py + sed -i '/^[[:space:]]*-c{env:.*_CONSTRAINTS_FILE.*/d' tox.ini + sed -i 's/^deps = -c{env:.*_CONSTRAINTS_FILE.*/deps =/' tox.ini + sed -i '/^minversion.*/d' tox.ini + sed -i '/^requires.*virtualenv.*/d' tox.ini + sed -i '/\.\[test,openstack\]/,+2d' tox.ini + sed -i '/\.*\[testenv\]deps/,+1d' tox.ini + sed -i '/\.\[test,doc\]/d' tox.ini + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.UX1uve + umask 022 + cd /builddir/build/BUILD + cd gnocchiclient-7.0.8 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo '(python3dist(tomli) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/gnocchiclient-7.0.8/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/gnocchiclient-7.0.8/.pyproject-builddir + RPM_TOXENV=py312 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/gnocchiclient-7.0.8/pyproject-wheeldir --output /builddir/build/BUILD/python-gnocchiclient-7.0.8-1.fc40.noarch-pyproject-buildrequires -t -e py312 Handling setuptools from build-system.requires Requirement satisfied: setuptools (installed: setuptools 68.2.2) Handling setuptools_scm from build-system.requires Requirement satisfied: setuptools_scm (installed: setuptools_scm 8.0.4) Handling wheel from build-system.requires Requirement satisfied: wheel (installed: wheel 0.41.2) running egg_info writing gnocchiclient.egg-info/PKG-INFO writing dependency_links to gnocchiclient.egg-info/dependency_links.txt writing entry points to gnocchiclient.egg-info/entry_points.txt writing requirements to gnocchiclient.egg-info/requires.txt writing top-level names to gnocchiclient.egg-info/top_level.txt reading manifest file 'gnocchiclient.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'gnocchiclient.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.41.2) Handling tox-current-env >= 0.0.6 from tox itself Requirement not satisfied: tox-current-env >= 0.0.6 Exiting dependency generation pass: tox itself + cat /builddir/build/BUILD/python-gnocchiclient-7.0.8-1.fc40.noarch-pyproject-buildrequires + rm -rfv '*.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-gnocchiclient-7.0.8-1.fc40.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details. ENTER ['do_with_status'](['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-gnocchiclient.spec'], chrootPath='/var/lib/mock/f40-build-2059167-49153/root'env={'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'}shell=Falselogger=timeout=864000uid=996gid=135user='mockbuild'nspawn_args=[]unshare_net=TrueraiseExc=FalseprintOutput=False) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -br --noclean --target noarch --nodeps /builddir/build/SPECS/python-gnocchiclient.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;\\007"', 'PS1': ' \\s-\\v\\$ ', 'LANG': 'C.UTF-8'} and shell False Building target platforms: noarch Building for target noarch setting SOURCE_DATE_EPOCH=1698192000 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.kvxz1x + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf gnocchiclient-7.0.8 + /usr/lib/rpm/rpmuncompress -x /builddir/build/SOURCES/gnocchiclient-7.0.8.tar.gz + STATUS=0 + '[' 0 -ne 0 ']' + cd gnocchiclient-7.0.8 + rm -rf /builddir/build/BUILD/gnocchiclient-7.0.8-SPECPARTS + /usr/bin/mkdir -p /builddir/build/BUILD/gnocchiclient-7.0.8-SPECPARTS + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + 2to3 --write --nobackups . /usr/bin/2to3:3: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+ from lib2to3.main import main RefactoringTool: Skipping optional fixer: buffer RefactoringTool: Skipping optional fixer: idioms RefactoringTool: Skipping optional fixer: set_literal RefactoringTool: Skipping optional fixer: ws_comma RefactoringTool: No changes to ./setup.py RefactoringTool: Refactored ./doc/source/conf.py RefactoringTool: No changes to ./gnocchiclient/auth.py RefactoringTool: Refactored ./gnocchiclient/benchmark.py RefactoringTool: No changes to ./gnocchiclient/client.py RefactoringTool: No changes to ./gnocchiclient/exceptions.py RefactoringTool: Refactored ./gnocchiclient/gendoc.py RefactoringTool: No changes to ./gnocchiclient/osc.py RefactoringTool: Refactored ./gnocchiclient/shell.py RefactoringTool: Refactored ./gnocchiclient/utils.py RefactoringTool: No changes to ./gnocchiclient/version.py RefactoringTool: No changes to ./gnocchiclient/tests/functional/base.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_aggregates.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_archive_policy.py --- ./doc/source/conf.py (original) +++ ./doc/source/conf.py (refactored) @@ -43,8 +43,8 @@ master_doc = 'index' # General information about the project. -project = u'Gnocchiclient' -copyright = u'%s, The Gnocchi Developers' % datetime.date.today().year +project = 'Gnocchiclient' +copyright = '%s, The Gnocchi Developers' % datetime.date.today().year # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the --- ./gnocchiclient/benchmark.py (original) +++ ./gnocchiclient/benchmark.py (refactored) @@ -37,10 +37,10 @@ def _pickle_method(m): - if m.im_self is None: - return getattr, (m.im_class, m.im_func.func_name) + if m.__self__ is None: + return getattr, (m.__self__.__class__, m.__func__.__name__) else: - return getattr, (m.im_self, m.im_func.func_name) + return getattr, (m.__self__, m.__func__.__name__) six.moves.copyreg.pickle(types.MethodType, _pickle_method) --- ./gnocchiclient/gendoc.py (original) +++ ./gnocchiclient/gendoc.py (refactored) @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import + import fnmatch @@ -24,7 +24,7 @@ class GnocchiAutoDocDirective(sphinxext.AutoprogramCliffDirective): def _load_commands(self): command_pattern = self.options.get('command') - full_cmd_list = shell.GnocchiCommandManager.SHELL_COMMANDS.keys() + full_cmd_list = list(shell.GnocchiCommandManager.SHELL_COMMANDS.keys()) if command_pattern: commands = [x for x in full_cmd_list if fnmatch.fnmatch(x, command_pattern)] --- ./gnocchiclient/shell.py (original) +++ ./gnocchiclient/shell.py (refactored) @@ -86,7 +86,7 @@ } def load_commands(self, namespace): - for name, command_class in self.SHELL_COMMANDS.items(): + for name, command_class in list(self.SHELL_COMMANDS.items()): self.add_command(name, command_class) @@ -199,10 +199,10 @@ else: if 'description' in error: # Gnocchi format - print(error['description']) + print((error['description'])) elif 'error' in error and 'message' in error['error']: # Keystone format - print(error['error']['message']) + print((error['error']['message'])) def configure_logging(self): if self.options.debug: --- ./gnocchiclient/utils.py (original) +++ ./gnocchiclient/utils.py (refactored) @@ -22,14 +22,14 @@ def add_query_argument(cmd, parser, *args, **kwargs): return parser.add_argument( cmd, - help=u"A query to filter resource. " - u"The syntax is a combination of attribute, operator and value. " - u"For example: id=90d58eea-70d7-4294-a49a-170dcdf44c3c would filter " - u"resource with a certain id. More complex queries can be built, " - u"e.g.: not (flavor_id!=\"1\" and memory>=24). " - u"Use \"\" to force data to be interpreted as string. " - u"Supported operators are: not, and, ∧ or, ∨, >=, <=, !=, >, <, =, " - u"==, eq, ne, lt, gt, ge, le, in, like, ≠, ≥, ≤, like, in.", + help="A query to filter resource. " + "The syntax is a combination of attribute, operator and value. " + "For example: id=90d58eea-70d7-4294-a49a-170dcdf44c3c would filter " + "resource with a certain id. More complex queries can be built, " + "e.g.: not (flavor_id!=\"1\" and memory>=24). " + "Use \"\" to force data to be interpreted as string. " + "Supported operators are: not, and, ∧ or, ∨, >=, <=, !=, >, <, =, " + "==, eq, ne, lt, gt, ge, le, in, like, ≠, ≥, ≤, like, in.", *args, **kwargs) @@ -45,15 +45,15 @@ def format_dict_list(li): return "\n".join( "- " + ", ".join("%s: %s" % (k, v) - for k, v in elem.items()) + for k, v in list(elem.items())) for elem in li) def format_dict_dict(value): return "\n".join( "- %s: " % name + " , ".join("%s: %s" % (k, v) - for k, v in elem.items()) - for name, elem in value.items()) + for k, v in list(elem.items())) + for name, elem in list(value.items())) def format_move_dict_to_root(obj, field): @@ -105,7 +105,7 @@ strings.append("&".join( ("%s=%s" % (k, v) for v in map(urllib_parse.quote, - map(six.text_type, values))))) + list(map(six.text_type, values)))))) return "&".join(strings) --- ./gnocchiclient/tests/functional/test_aggregates.py (original) +++ ./gnocchiclient/tests/functional/test_aggregates.py (refactored) @@ -25,9 +25,9 @@ # CREATE A METRIC result = self.gnocchi( - u'metric', params=u"create" - u' -r metric-res1' - u" --archive-policy-name agg-fetch-test metric-name") + 'metric', params="create" + ' -r metric-res1' + " --archive-policy-name agg-fetch-test metric-name") metric1 = json.loads(result) self.assertIsNotNone(metric1["id"]) self.assertEqual("admin", metric1["creator"]) @@ -38,10 +38,10 @@ # CREATE ANOTHER METRIC result = self.gnocchi( - u'metric', params=u"create" - u' -r metric-res2' - u" --archive-policy-name agg-fetch-test" - u" --unit some-unit metric-name") + 'metric', params="create" + ' -r metric-res2' + " --archive-policy-name agg-fetch-test" + " --unit some-unit metric-name") metric2 = json.loads(result) self.assertIsNotNone(metric2["id"]) self.assertEqual("admin", metric2["creator"]) @@ -113,22 +113,22 @@ measures = json.loads(result) self.assertEqual(4, len(measures)) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r1["id"], - 'timestamp': u'2015-03-06T14:33:57+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r1["id"], + 'timestamp': '2015-03-06T14:33:57+00:00', 'value': 45.11}, measures) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r1["id"], - 'timestamp': u'2015-03-06T14:34:12+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r1["id"], + 'timestamp': '2015-03-06T14:34:12+00:00', 'value': 14.0}, measures) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r2["id"], - 'timestamp': u'2015-03-06T14:33:57+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r2["id"], + 'timestamp': '2015-03-06T14:33:57+00:00', 'value': 45.11}, measures) self.assertIn({'granularity': 1.0, - 'group': u'project_id: None, user_id: None', - 'name': u'%s/metric-name/mean' % r2["id"], - 'timestamp': u'2015-03-06T14:34:12+00:00', + 'group': 'project_id: None, user_id: None', + 'name': '%s/metric-name/mean' % r2["id"], + 'timestamp': '2015-03-06T14:34:12+00:00', 'value': 14.0}, measures) RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_archive_policy_rule.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_benchmark.py RefactoringTool: No changes to ./gnocchiclient/tests/functional/test_capabilities.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_metric.py --- ./gnocchiclient/tests/functional/test_archive_policy.py (original) +++ ./gnocchiclient/tests/functional/test_archive_policy.py (refactored) @@ -20,17 +20,17 @@ # CREATE apname = str(uuid.uuid4()) result = self.gnocchi( - u'archive-policy', params=u"create %s" - u" --back-window 0" - u" -d granularity:1s,points:86400" % apname) + 'archive-policy', params="create %s" + " --back-window 0" + " -d granularity:1s,points:86400" % apname) policy = json.loads(result) self.assertEqual(apname, policy["name"]) # CREATE FAIL result = self.gnocchi( - u'archive-policy', params=u"create %s" - u" --back-window 0" - u" -d granularity:1s,points:86400" % apname, + 'archive-policy', params="create %s" + " --back-window 0" + " -d granularity:1s,points:86400" % apname, fail_ok=True, merge_stderr=True) self.assertEqual( "Archive policy %s already exists (HTTP 409)\n" % apname, --- ./gnocchiclient/tests/functional/test_archive_policy_rule.py (original) +++ ./gnocchiclient/tests/functional/test_archive_policy_rule.py (refactored) @@ -20,22 +20,22 @@ apname = str(uuid.uuid4()) # Create an archive policy self.gnocchi( - u'archive-policy', params=u"create %s" - u" -d granularity:1s,points:86400" % apname) + 'archive-policy', params="create %s" + " -d granularity:1s,points:86400" % apname) # CREATE result = self.gnocchi( - u'archive-policy-rule', params=u"create test" - u" --archive-policy-name %s" - u" --metric-pattern 'disk.io.*'" % apname) + 'archive-policy-rule', params="create test" + " --archive-policy-name %s" + " --metric-pattern 'disk.io.*'" % apname) policy_rule = json.loads(result) self.assertEqual('test', policy_rule["name"]) # CREATE FAIL result = self.gnocchi( - u'archive-policy-rule', params=u"create test" - u" --archive-policy-name high" - u" --metric-pattern 'disk.io.*'", + 'archive-policy-rule', params="create test" + " --archive-policy-name high" + " --metric-pattern 'disk.io.*'", fail_ok=True, merge_stderr=True) self.assertEqual( "Archive policy rule test already exists (HTTP 409)\n", @@ -56,12 +56,12 @@ # CREATE - RENAME - GET self.gnocchi( - u'archive-policy-rule', params=u"create to_rename" - u" --archive-policy-name %s" - u" --metric-pattern 'disk.io.*'" % apname) + 'archive-policy-rule', params="create to_rename" + " --archive-policy-name %s" + " --metric-pattern 'disk.io.*'" % apname) result = self.gnocchi( - u'archive-policy-rule', params=u'update to_rename' - u' --name renamed') + 'archive-policy-rule', params='update to_rename' + ' --name renamed') policy_rule = json.loads(result) self.assertEqual('renamed', policy_rule["name"]) --- ./gnocchiclient/tests/functional/test_benchmark.py (original) +++ ./gnocchiclient/tests/functional/test_benchmark.py (refactored) @@ -18,7 +18,7 @@ class BenchmarkMetricTest(base.ClientTestBase): def test_benchmark_metric_create_wrong_workers(self): result = self.gnocchi( - u'benchmark', params=u"metric create -n 0", + 'benchmark', params="metric create -n 0", fail_ok=True, merge_stderr=True) self.assertIn("0 must be greater than 0", result) @@ -29,7 +29,7 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'benchmark', params=u"metric create -n 10 -a %s" % apname) + 'benchmark', params="metric create -n 10 -a %s" % apname) result = json.loads(result) self.assertEqual(10, int(result['create executed'])) self.assertLessEqual(int(result['create failures']), 10) @@ -37,7 +37,7 @@ int(result['create executed'])) result = self.gnocchi( - u'benchmark', params=u"metric create -k -n 10 -a %s" % apname) + 'benchmark', params="metric create -k -n 10 -a %s" % apname) result = json.loads(result) self.assertEqual(10, int(result['create executed'])) self.assertLessEqual(int(result['create failures']), 10) @@ -50,11 +50,11 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'metric', params=u"create -a %s" % apname) + 'metric', params="create -a %s" % apname) metric = json.loads(result) result = self.gnocchi( - u'benchmark', params=u"metric show -n 10 %s" % metric['id']) + 'benchmark', params="metric show -n 10 %s" % metric['id']) result = json.loads(result) self.assertEqual(10, int(result['show executed'])) self.assertLessEqual(int(result['show failures']), 10) @@ -66,26 +66,26 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'metric', params=u"create -a %s" % apname) + 'metric', params="create -a %s" % apname) metric = json.loads(result) result = self.gnocchi( - u'benchmark', params=u"measures add -n 10 -b 4 %s" % metric['id']) + 'benchmark', params="measures add -n 10 -b 4 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['push executed'])) self.assertLessEqual(int(result['push failures']), 2) result = self.gnocchi( - u'benchmark', - params=u"measures add -s 2010-01-01 -n 10 -b 4 %s" + 'benchmark', + params="measures add -s 2010-01-01 -n 10 -b 4 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['push executed'])) self.assertLessEqual(int(result['push failures']), 2) result = self.gnocchi( - u'benchmark', - params=u"measures add --wait -s 2010-01-01 -n 10 -b 4 %s" + 'benchmark', + params="measures add --wait -s 2010-01-01 -n 10 -b 4 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['push executed'])) @@ -99,12 +99,12 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) result = self.gnocchi( - u'metric', params=u"create -a %s" % apname) + 'metric', params="create -a %s" % apname) metric = json.loads(result) result = self.gnocchi( - u'benchmark', - params=u"measures show -n 2 %s" + 'benchmark', + params="measures show -n 2 %s" % metric['id']) result = json.loads(result) self.assertEqual(2, int(result['show executed'])) --- ./gnocchiclient/tests/functional/test_metric.py (original) +++ ./gnocchiclient/tests/functional/test_metric.py (refactored) @@ -28,13 +28,13 @@ "--back-window 0 -d granularity:1s,points:86400" % apname) # Create 2 metrics result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name %s" % apname) + 'metric', params="create" + " --archive-policy-name %s" % apname) metric1 = json.loads(result) result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name %s" % apname) + 'metric', params="create" + " --archive-policy-name %s" % apname) metric2 = json.loads(result) # DELETE @@ -68,11 +68,11 @@ for i in range(1005): c.metric.create({"archive_policy_name": apname}) RefactoringTool: No changes to ./gnocchiclient/tests/functional/test_osc.py RefactoringTool: No changes to ./gnocchiclient/tests/functional/test_others.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_resource.py RefactoringTool: Refactored ./gnocchiclient/tests/functional/test_resource_type.py - result = self.gnocchi(u'metric', params=u"list") + result = self.gnocchi('metric', params="list") self.assertGreaterEqual(len(json.loads(result)), 1005) - result = self.gnocchi(u'metric', params=u"list" - u" --limit 2") + result = self.gnocchi('metric', params="list" + " --limit 2") self.assertEqual(2, len(json.loads(result))) def test_metric_measures_exhautic_format(self): @@ -83,8 +83,8 @@ # CREATE METRIC metric_name = str(uuid.uuid4()) result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name " + ap_name + " " + metric_name) + 'metric', params="create" + " --archive-policy-name " + ap_name + " " + metric_name) metric = json.loads(result) # MEASURES ADD @@ -108,8 +108,8 @@ # CREATE METRIC metric_name = str(uuid.uuid4()) result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name " + ap_name + " " + metric_name) + 'metric', params="create" + " --archive-policy-name " + ap_name + " " + metric_name) metric = json.loads(result) # MEASURES ADD @@ -145,8 +145,8 @@ # CREATE WITH NAME AND WITHOUT UNIT result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name metric-test some-name") + 'metric', params="create" + " --archive-policy-name metric-test some-name") metric = json.loads(result) self.assertIsNotNone(metric["id"]) self.assertEqual("admin", metric["creator"]) @@ -157,9 +157,9 @@ # CREATE WITH UNIT result = self.gnocchi( - u'metric', params=u"create another-name" - u" --archive-policy-name metric-test" - u" --unit some-unit") + 'metric', params="create another-name" + " --archive-policy-name metric-test" + " --unit some-unit") metric = json.loads(result) self.assertIsNotNone(metric["id"]) self.assertEqual("admin", metric["creator"]) @@ -238,7 +238,7 @@ self.assertEqual([ {'granularity': 3600.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:00:00+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:00:00+00:00')).isoformat(), 'value': 27.555} ], measures) @@ -327,9 +327,9 @@ metric_name = str(uuid.uuid4()) # CREATE result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name metric-test2 -r metric-res %s" - u" --unit some-unit" % metric_name) + 'metric', params="create" + " --archive-policy-name metric-test2 -r metric-res %s" + " --unit some-unit" % metric_name) metric = json.loads(result) self.assertIsNotNone(metric["id"]) self.assertEqual("admin", metric['creator']) @@ -340,8 +340,8 @@ # CREATE FAIL result = self.gnocchi( - u'metric', params=u"create" - u" --archive-policy-name metric-test2 " + 'metric', params="create" + " --archive-policy-name metric-test2 " "-r metric-res %s" % metric_name, fail_ok=True, merge_stderr=True) self.assertEqual( @@ -403,11 +403,11 @@ self.assertEqual([ {'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), - 'value': 43.11}, - {'granularity': 1.0, - 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), + 'value': 43.11}, + {'granularity': 1.0, + 'timestamp': utils.dt_to_localtz( + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0} ], measures) @@ -425,11 +425,11 @@ self.assertEqual([ {'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), - 'value': 43.11}, - {'granularity': 1.0, - 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), + 'value': 43.11}, + {'granularity': 1.0, + 'timestamp': utils.dt_to_localtz( + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0} ], measures) @@ -469,12 +469,12 @@ {'group': 'project_id: None, user_id: None', 'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), 'value': 43.11}, {'group': 'project_id: None, user_id: None', 'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0}, ], measures) @@ -489,11 +489,11 @@ self.assertEqual([ {'granularity': 1.0, 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:33:57+00:00')).isoformat(), - 'value': 43.11}, - {'granularity': 1.0, - 'timestamp': utils.dt_to_localtz( - utils.parse_date(u'2015-03-06T14:34:12+00:00')).isoformat(), + utils.parse_date('2015-03-06T14:33:57+00:00')).isoformat(), + 'value': 43.11}, + {'granularity': 1.0, + 'timestamp': utils.dt_to_localtz( + utils.parse_date('2015-03-06T14:34:12+00:00')).isoformat(), 'value': 12.0}, ], measures) --- ./gnocchiclient/tests/functional/test_resource.py (original) +++ ./gnocchiclient/tests/functional/test_resource.py (refactored) @@ -29,12 +29,12 @@ apname = str(uuid.uuid4()) # Create an archive policy self.gnocchi( - u'archive-policy', params=u"create %s" - u" -d granularity:1s,points:86400" % apname) + 'archive-policy', params="create %s" + " -d granularity:1s,points:86400" % apname) # CREATE result = self.gnocchi( - u'resource', params=u"create %s --type generic" % + 'resource', params="create %s --type generic" % self.RESOURCE_ID) resource = json.loads(result) self.assertEqual(self.RESOURCE_ID, resource["id"]) @@ -170,10 +170,10 @@ # Create and Batch Delete result1 = self.gnocchi( - u'resource', params=u"create %s --type generic" % + 'resource', params="create %s --type generic" % self.RESOURCE_ID) result2 = self.gnocchi( - u'resource', params=u"create %s --type generic" % + 'resource', params="create %s --type generic" % self.RESOURCE_ID2) resource1 = json.loads(result1) resource2 = json.loads(result2) --- ./gnocchiclient/tests/functional/test_resource_type.py (original) +++ ./gnocchiclient/tests/functional/test_resource_type.py (refactored) @@ -30,8 +30,8 @@ # CREATE result = self.gnocchi( - u'resource-type', - params=u"create -a foo:string:true:max_length=16 " + 'resource-type', + params="create -a foo:string:true:max_length=16 " "-a bar:number:no:max=32 %s" % self.RESOURCE_TYPE) resource = json.loads(result) RefactoringTool: No changes to ./gnocchiclient/tests/unit/test_auth.py RefactoringTool: No changes to ./gnocchiclient/tests/unit/test_exceptions.py RefactoringTool: No changes to ./gnocchiclient/v1/aggregates.py RefactoringTool: No changes to ./gnocchiclient/v1/aggregates_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy_rule.py RefactoringTool: No changes to ./gnocchiclient/v1/archive_policy_rule_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/base.py RefactoringTool: No changes to ./gnocchiclient/v1/build.py RefactoringTool: No changes to ./gnocchiclient/v1/build_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/capabilities.py RefactoringTool: No changes to ./gnocchiclient/v1/capabilities_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/client.py RefactoringTool: No changes to ./gnocchiclient/v1/metric.py RefactoringTool: No changes to ./gnocchiclient/v1/metric_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/resource.py RefactoringTool: Refactored ./gnocchiclient/v1/resource_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/resource_type.py RefactoringTool: Refactored ./gnocchiclient/v1/resource_type_cli.py RefactoringTool: No changes to ./gnocchiclient/v1/status.py RefactoringTool: No changes to ./gnocchiclient/v1/status_cli.py RefactoringTool: Files that were modified: RefactoringTool: ./setup.py RefactoringTool: ./doc/source/conf.py RefactoringTool: ./gnocchiclient/auth.py RefactoringTool: ./gnocchiclient/benchmark.py RefactoringTool: ./gnocchiclient/client.py RefactoringTool: ./gnocchiclient/exceptions.py RefactoringTool: ./gnocchiclient/gendoc.py RefactoringTool: ./gnocchiclient/osc.py RefactoringTool: ./gnocchiclient/shell.py RefactoringTool: ./gnocchiclient/utils.py RefactoringTool: ./gnocchiclient/version.py RefactoringTool: ./gnocchiclient/tests/functional/base.py RefactoringTool: ./gnocchiclient/tests/functional/test_aggregates.py RefactoringTool: ./gnocchiclient/tests/functional/test_archive_policy.py RefactoringTool: ./gnocchiclient/tests/functional/test_archive_policy_rule.py RefactoringTool: ./gnocchiclient/tests/functional/test_benchmark.py RefactoringTool: ./gnocchiclient/tests/functional/test_capabilities.py RefactoringTool: ./gnocchiclient/tests/functional/test_metric.py RefactoringTool: ./gnocchiclient/tests/functional/test_osc.py RefactoringTool: ./gnocchiclient/tests/functional/test_others.py RefactoringTool: ./gnocchiclient/tests/functional/test_resource.py RefactoringTool: ./gnocchiclient/tests/functional/test_resource_type.py RefactoringTool: ./gnocchiclient/tests/unit/test_auth.py RefactoringTool: ./gnocchiclient/tests/unit/test_exceptions.py RefactoringTool: ./gnocchiclient/v1/aggregates.py RefactoringTool: ./gnocchiclient/v1/aggregates_cli.py RefactoringTool: ./gnocchiclient/v1/archive_policy.py RefactoringTool: ./gnocchiclient/v1/archive_policy_cli.py RefactoringTool: ./gnocchiclient/v1/archive_policy_rule.py RefactoringTool: ./gnocchiclient/v1/archive_policy_rule_cli.py RefactoringTool: ./gnocchiclient/v1/base.py RefactoringTool: ./gnocchiclient/v1/build.py RefactoringTool: ./gnocchiclient/v1/build_cli.py RefactoringTool: ./gnocchiclient/v1/capabilities.py RefactoringTool: ./gnocchiclient/v1/capabilities_cli.py RefactoringTool: ./gnocchiclient/v1/client.py RefactoringTool: ./gnocchiclient/v1/metric.py RefactoringTool: ./gnocchiclient/v1/metric_cli.py RefactoringTool: ./gnocchiclient/v1/resource.py RefactoringTool: ./gnocchiclient/v1/resource_cli.py RefactoringTool: ./gnocchiclient/v1/resource_type.py RefactoringTool: ./gnocchiclient/v1/resource_type_cli.py self.assertEqual(self.RESOURCE_TYPE, resource["name"]) @@ -41,7 +41,7 @@ # SHOW result = self.gnocchi( - u'resource-type', params=u"show %s" % self.RESOURCE_TYPE) + 'resource-type', params="show %s" % self.RESOURCE_TYPE) resource = json.loads(result) self.assertEqual(self.RESOURCE_TYPE, resource["name"]) self.assertEqual( @@ -50,8 +50,8 @@ # PATCH result = self.gnocchi( - u'resource-type', - params=u"update -r foo " + 'resource-type', + params="update -r foo " "-a new:number:yes:max=16:fill=8 %s" % self.RESOURCE_TYPE) resource = json.loads(result) self.assertEqual(self.RESOURCE_TYPE, resource["name"]) @@ -62,7 +62,7 @@ # SHOW result = self.gnocchi( - u'resource-type', params=u"show %s" % self.RESOURCE_TYPE) + 'resource-type', params="show %s" % self.RESOURCE_TYPE) resource = json.loads(result) self.assertEqual(self.RESOURCE_TYPE, resource["name"]) self.assertNotIn("attributes/foo", resource) @@ -72,7 +72,7 @@ # Create a resource for this type result = self.gnocchi( - u'resource', params=(u"create %s -t %s -a new:5") % + 'resource', params=("create %s -t %s -a new:5") % (self.RESOURCE_ID, self.RESOURCE_TYPE)) resource = json.loads(result) self.assertEqual(self.RESOURCE_ID, resource["id"]) @@ -98,8 +98,8 @@ result) # SHOW AGAIN - result = self.gnocchi(u'resource-type', - params=u"show %s" % self.RESOURCE_TYPE, + result = self.gnocchi('resource-type', + params="show %s" % self.RESOURCE_TYPE, fail_ok=True, merge_stderr=True) self.assertEqual( "Resource type %s does not exist (HTTP 404)\n" --- ./gnocchiclient/v1/resource_cli.py (original) +++ ./gnocchiclient/v1/resource_cli.py (refactored) @@ -115,7 +115,7 @@ def normalize_metrics(res): res['metrics'] = "\n".join(sorted( ["%s: %s" % (name, _id) - for name, _id in res['metrics'].items()])) + for name, _id in list(res['metrics'].items())])) return res --- ./gnocchiclient/v1/resource_type_cli.py (original) +++ ./gnocchiclient/v1/resource_type_cli.py (refactored) @@ -42,14 +42,14 @@ parser.add_argument("-a", "--attribute", action='append', type=self._resource_attribute, default=[], - help=(u"attribute definition, " - u"attribute_name:" - u"attribute_type:" - u"attribute_is_required:" - u"attribute_type_option_name=" - u"attribute_type_option_value:... " - u"For example: " - u"display_name:string:true:max_length=255")) + help=("attribute definition, " + "attribute_name:" + "attribute_type:" + "attribute_is_required:" + "attribute_type_option_name=" + "attribute_type_option_value:... " + "For example: " + "display_name:string:true:max_length=255")) return parser @classmethod @@ -90,7 +90,7 @@ parser = super(CliResourceTypeUpdate, self).get_parser(prog_name) parser.add_argument("-r", "--remove-attribute", action='append', default=[], - help=u"attribute name") + help="attribute name") return parser RefactoringTool: ./gnocchiclient/v1/status.py RefactoringTool: ./gnocchiclient/v1/status_cli.py + sed -i '/^[[:space:]]*-c{env:.*_CONSTRAINTS_FILE.*/d' tox.ini + sed -i 's/^deps = -c{env:.*_CONSTRAINTS_FILE.*/deps =/' tox.ini + sed -i '/^minversion.*/d' tox.ini + sed -i '/^requires.*virtualenv.*/d' tox.ini + sed -i '/\.\[test,openstack\]/,+2d' tox.ini + sed -i '/\.*\[testenv\]deps/,+1d' tox.ini + sed -i '/\.\[test,doc\]/d' tox.ini + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + for pkg in doc8 bandit pre-commit hacking flake8-import-order sphinx openstackdocstheme + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f doc/requirements.txt ']' + for reqfile in doc/requirements.txt test-requirements.txt + '[' -f test-requirements.txt ']' + RPM_EC=0 ++ jobs -p + exit 0 Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.Q6sKe5 + umask 022 + cd /builddir/build/BUILD + cd gnocchiclient-7.0.8 + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer ' + export CFLAGS + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer ' + export CXXFLAGS + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FFLAGS + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer -I/usr/lib/gfortran/modules ' + export FCFLAGS + VALAFLAGS=-g + export VALAFLAGS + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-Wl,-z,relro -Clink-arg=-Wl,-z,now --cap-lints=warn' + export RUSTFLAGS + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + export LDFLAGS + LT_SYS_LIBRARY_PATH=/usr/lib: + export LT_SYS_LIBRARY_PATH + CC=gcc + export CC + CXX=g++ + export CXX + echo pyproject-rpm-macros + echo python3-devel + echo 'python3dist(pip) >= 19' + echo 'python3dist(packaging)' + '[' -f pyproject.toml ']' + echo '(python3dist(tomli) if python3-devel < 3.11)' + rm -rfv '*.dist-info/' + '[' -f /usr/bin/python3 ']' + mkdir -p /builddir/build/BUILD/gnocchiclient-7.0.8/.pyproject-builddir + echo -n + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fno-omit-frame-pointer ' + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' + TMPDIR=/builddir/build/BUILD/gnocchiclient-7.0.8/.pyproject-builddir + RPM_TOXENV=py312 + HOSTNAME=rpmbuild + /usr/bin/python3 -Bs /usr/lib/rpm/redhat/pyproject_buildrequires.py --generate-extras --python3_pkgversion 3 --wheeldir /builddir/build/BUILD/gnocchiclient-7.0.8/pyproject-wheeldir --output /builddir/build/BUILD/python-gnocchiclient-7.0.8-1.fc40.noarch-pyproject-buildrequires -t -e py312 Handling setuptools from build-system.requires Requirement satisfied: setuptools (installed: setuptools 68.2.2) Handling setuptools_scm from build-system.requires Requirement satisfied: setuptools_scm (installed: setuptools_scm 8.0.4) Handling wheel from build-system.requires Requirement satisfied: wheel (installed: wheel 0.41.2) running egg_info writing gnocchiclient.egg-info/PKG-INFO writing dependency_links to gnocchiclient.egg-info/dependency_links.txt writing entry points to gnocchiclient.egg-info/entry_points.txt writing requirements to gnocchiclient.egg-info/requires.txt writing top-level names to gnocchiclient.egg-info/top_level.txt reading manifest file 'gnocchiclient.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'gnocchiclient.egg-info/SOURCES.txt' Handling wheel from get_requires_for_build_wheel Requirement satisfied: wheel (installed: wheel 0.41.2) Handling tox-current-env >= 0.0.6 from tox itself Requirement satisfied: tox-current-env >= 0.0.6 (installed: tox-current-env 0.0.11) py312: OK (0.39 seconds) congratulations :) (2.74 seconds) Handling tox from tox --print-deps-only: py312 Requirement satisfied: tox (installed: tox 4.11.1) running dist_info writing gnocchiclient.egg-info/PKG-INFO writing dependency_links to gnocchiclient.egg-info/dependency_links.txt writing entry points to gnocchiclient.egg-info/entry_points.txt writing requirements to gnocchiclient.egg-info/requires.txt writing top-level names to gnocchiclient.egg-info/top_level.txt reading manifest file 'gnocchiclient.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'gnocchiclient.egg-info/SOURCES.txt' creating '/builddir/build/BUILD/gnocchiclient-7.0.8/gnocchiclient-7.0.8.dist-info' The [wheel] section is deprecated. Use [bdist_wheel] instead. Handling cliff >=2.10 from hook generated metadata: Requires-Dist (gnocchiclient) Requirement not satisfied: cliff >=2.10 Handling ujson from hook generated metadata: Requires-Dist (gnocchiclient) Requirement not satisfied: ujson Handling keystoneauth1 >=2.0.0 from hook generated metadata: Requires-Dist (gnocchiclient) Requirement not satisfied: keystoneauth1 >=2.0.0 Handling six from hook generated metadata: Requires-Dist (gnocchiclient) Requirement not satisfied: six Handling futurist from hook generated metadata: Requires-Dist (gnocchiclient) Requirement not satisfied: futurist Handling iso8601 from hook generated metadata: Requires-Dist (gnocchiclient) Requirement not satisfied: iso8601 Handling python-dateutil from hook generated metadata: Requires-Dist (gnocchiclient) Requirement not satisfied: python-dateutil Handling debtcollector from hook generated metadata: Requires-Dist (gnocchiclient) Requirement not satisfied: debtcollector Handling sphinx ; extra == 'doc' from hook generated metadata: Requires-Dist (gnocchiclient) Ignoring alien requirement: sphinx ; extra == 'doc' Handling sphinx-rtd-theme ; extra == 'doc' from hook generated metadata: Requires-Dist (gnocchiclient) Ignoring alien requirement: sphinx-rtd-theme ; extra == 'doc' Handling osc-lib >=0.3.0 ; extra == 'openstack' from hook generated metadata: Requires-Dist (gnocchiclient) Ignoring alien requirement: osc-lib >=0.3.0 ; extra == 'openstack' Handling python-openstackclient ; extra == 'test' from hook generated metadata: Requires-Dist (gnocchiclient) Ignoring alien requirement: python-openstackclient ; extra == 'test' Handling pytest ; extra == 'test' from hook generated metadata: Requires-Dist (gnocchiclient) Ignoring alien requirement: pytest ; extra == 'test' Handling pytest-xdist ; extra == 'test' from hook generated metadata: Requires-Dist (gnocchiclient) Ignoring alien requirement: pytest-xdist ; extra == 'test' + cat /builddir/build/BUILD/python-gnocchiclient-7.0.8-1.fc40.noarch-pyproject-buildrequires + rm -rfv gnocchiclient-7.0.8.dist-info/ removed 'gnocchiclient-7.0.8.dist-info/LICENSE' removed 'gnocchiclient-7.0.8.dist-info/entry_points.txt' removed 'gnocchiclient-7.0.8.dist-info/top_level.txt' removed 'gnocchiclient-7.0.8.dist-info/METADATA' removed directory 'gnocchiclient-7.0.8.dist-info/' + RPM_EC=0 ++ jobs -p + exit 0 Wrote: /builddir/build/SRPMS/python-gnocchiclient-7.0.8-1.fc40.buildreqs.nosrc.rpm Child return code was: 11 Dynamic buildrequires detected Going to install missing buildrequires. See root.log for details.