Skip to content

Commit e15c764

Browse files
Nachiket Vaidyajenkins
authored andcommitted
[DR] OPSAPS-35892 cm_api changes for HDFS Cloud replication schedule args
o Cloud HDFS Replication now has two for cloud accounts. o user is expected to use one of them for given schedule. o Unit test case changes.
1 parent 0f11f2e commit e15c764

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

python/src/cm_api/endpoints/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,8 @@ class ApiHdfsCloudReplicationArguments(ApiHdfsReplicationArguments):
713713
def _get_attributes(cls):
714714
if not cls.__dict__.has_key('_ATTRIBUTES'):
715715
attrs = {
716-
'cloudAccount' : None,
717-
'cloudService' : None,
716+
'sourceAccount' : None,
717+
'destinationAccount' : None,
718718
}
719719
attrs.update(ApiHdfsReplicationArguments._get_attributes())
720720
cls._ATTRIBUTES = attrs

python/src/cm_api_tests/test_replication.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ def test_hdfs_cloud_arguments(self):
9696
"bandwidthPerMap" : "20",
9797
"preserveXAttrs" : false,
9898
"exclusionFilters" : ["ac"],
99-
"cloudAccount" : "someTestAccount",
100-
"cloudService" : "TARGET"
99+
"sourceAccount" : "someTestAccount"
101100
}'''
102101
args = utils.deserialize(RAW, ApiHdfsCloudReplicationArguments)
103102
self.assertEquals('vst2', args.sourceService.peerName)
@@ -117,8 +116,8 @@ def test_hdfs_cloud_arguments(self):
117116
self.assertFalse(args.skipTrash)
118117
self.assertEquals('DYNAMIC', args.replicationStrategy)
119118
self.assertFalse(args.preserveXAttrs)
120-
self.assertEquals('someTestAccount', args.cloudAccount)
121-
self.assertEquals('TARGET', args.cloudService)
119+
self.assertEquals('someTestAccount', args.sourceAccount)
120+
self.assertEquals(None, args.destinationAccount)
122121

123122
def test_hive_arguments(self):
124123
RAW = '''{
@@ -388,8 +387,7 @@ def test_hdfs_cloud_replication_crud(self):
388387
hdfs_args.sourceService = ApiServiceRef('cluster2', 'hdfs2')
389388
hdfs_args.sourcePath = '/src'
390389
hdfs_args.destinationPath = 's3a://somebucket/dst'
391-
hdfs_args.cloudAccount = 'someTestAccount'
392-
hdfs_args.cloudService = 'TARGET'
390+
hdfs_args.destinationAccount = 'someTestAccount'
393391

394392
return_sched = ApiReplicationSchedule(self.resource,
395393
interval=2, intervalUnit='DAY')

0 commit comments

Comments
 (0)