Skip to content

Commit e58b3cc

Browse files
author
Philip Zeyliger
committed
OPSAPS-26038. Conditionalize 'roles' argument.
Tests running against older CM versions had the following error: test_support_bundle45 fails with error: Unrecognized property: 'roles' (error 400) As it turns out, we have the capability to set an API version when using the python client, and the client should take care of things like this, so I've done so. To test this, I ran: $ cp ~/src/cm_api/python/src/cm_api/endpoints/cms.py ./target/env/lib/python2.7/site-packages/cm_api/endpoints/cms.py $ systest.py --agents="cdh5+parcels@nightly53-{1..4}.ent.cloudera.com" run_tests -n "test_support_bundle:SupportBundleTests.test_support_bundle_45" --disable-pre-validations --version cm53 Before my change (that I manually cherrypicked in the first hand): ApiException: Unrecognized property: 'roles' (error 400) ---------------------------------------------------------------------- Ran 1 test in 0.499s FAILED (errors=1) False After: *********************************************************************** * End test_support_bundle_45 (test_support_bundle.SupportBundleTests) * *********************************************************************** ---------------------------------------------------------------------- Ran 1 test in 128.929s I also tested against nightly (5.5) to make sure this didn't regress. It passed. $./systest.py --agents="cdh5+parcels@nightly-{1..4}.ent.cloudera.com" run_tests -n "test_support_bundle:SupportBundleTests.test_support_bundle_45" --disable-pre-validations
1 parent dcc11df commit e58b3cc

File tree

1 file changed

+3
-2
lines changed
  • python/src/cm_api/endpoints

1 file changed

+3
-2
lines changed

python/src/cm_api/endpoints/cms.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,10 @@ def collect_diagnostic_data_45(self, end_datetime, bundle_size_bytes, cluster_na
201201
args = {
202202
'endTime': end_datetime.isoformat(),
203203
'bundleSizeBytes': bundle_size_bytes,
204-
'clusterName': cluster_name,
205-
'roles': roles
204+
'clusterName': cluster_name
206205
}
206+
if self._get_resource_root().version >= 10:
207+
args['roles'] = roles
207208
return self._cmd('collectDiagnosticData', data=args)
208209

209210
def hosts_decommission(self, host_names):

0 commit comments

Comments
 (0)