Skip to content

Commit e20d027

Browse files
bgkleinxingwu1
authored andcommitted
Fix array bug (#104)
* Fix array bug * Change to json recordings because yaml serializer broken
1 parent c23859f commit e20d027

File tree

9 files changed

+12666
-6029
lines changed

9 files changed

+12666
-6029
lines changed

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
SDK Release History
44
===================
55

6+
5.0.5 (2019-02-25)
7+
------------------
8+
9+
* Fix bug in blobSource conversion to httpUrl
10+
611
5.0.4 (2019-02-25)
712
------------------
813

azext/batch/_template_utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,11 @@ def validate_json_object(json_obj, obj):
12031203

12041204

12051205
def convert_blob_source_to_http_url(obj):
1206+
if isinstance(obj, list):
1207+
out = []
1208+
for i in obj:
1209+
out.append(convert_blob_source_to_http_url(i))
1210+
return out
12061211
if isinstance(obj, dict):
12071212
for key in obj:
12081213
if key in ['resourceFiles', 'commonResourceFiles']:

azext/batch/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
VERSION = "5.0.4"
6+
VERSION = "5.0.5"

batch-cli-extensions/azext_batch/commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414

1515
logger = get_logger(__name__)
16-
SUPPORTED_BATCH_VERSION = "5.2"
17-
SUPPORTED_BMGMT_VERSION = "5.1"
18-
SUPPORTED_BATCH_EXT_VERSION = "4.1"
16+
SUPPORTED_BATCH_VERSION = "6.0"
17+
SUPPORTED_BMGMT_VERSION = "6.0"
18+
SUPPORTED_BATCH_EXT_VERSION = "5.0"
1919

2020

2121
def confirm_version(current, supported, package):
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"job": {
3+
"type": "Microsoft.Batch/batchAccounts/jobs",
4+
"apiVersion": "2018-12-01",
5+
"properties": {
6+
"id": "job123",
7+
"onAllTasksComplete": "terminateJob",
8+
"poolInfo": {
9+
"autoPoolSpecification": {
10+
"autoPoolIdPrefix": "pool123",
11+
"poolLifetimeOption": "job",
12+
"keepAlive": false,
13+
"pool": {
14+
"vmSize": "STANDARD_D1_V2",
15+
"virtualMachineConfiguration": {
16+
"imageReference": {
17+
"publisher": "Canonical",
18+
"offer": "UbuntuServer",
19+
"sku": "16.04.0-LTS",
20+
"version": "latest"
21+
},
22+
"nodeAgentSKUId": "batch.node.ubuntu 16.04"
23+
},
24+
"targetDedicatedNodes": "1"
25+
}
26+
}
27+
},
28+
"taskFactory": {
29+
"type": "taskCollection",
30+
"tasks": [
31+
{
32+
"id": "1",
33+
"commandLine": "/bin/bash -c 'cat {fileName}'",
34+
"resourceFiles": [
35+
{
36+
"httpUrl": "fake.url",
37+
"filePath": "location"
38+
}
39+
]
40+
}
41+
]
42+
}
43+
}
44+
}
45+
}

tests/recordings/test_batch_extensions_live.yaml

Lines changed: 11885 additions & 5759 deletions
Large diffs are not rendered by default.

tests/recordings/test_batch_upload_live.yaml

Lines changed: 715 additions & 264 deletions
Large diffs are not rendered by default.

tests/test_live.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,11 @@ def body(self):
441441
self.wait_for_pool_steady(pool_param.id, 5 * 60)
442442
self.batch_client.pool.delete(pool_param.id)
443443

444+
# Batch simple legacy task factory
445+
self.cmd("batch job create --template '{}'".format(os.path.join(
446+
self.data_dir,
447+
'batch.job.resourcefile-legacy.json')))
448+
444449
# Merge Task
445450
self.cmd("batch file upload --file-group 'in' --local-path '{}'".format(self.data_dir))
446451
self.cmd("batch job create --template '{}'".format(os.path.join(

tests/vcr_test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ def __init__(self, test_file, test_name, run_live=False, debug=False, debug_vcr=
277277
cassette_library_dir=self.recording_dir,
278278
before_record_request=self._before_record_request,
279279
before_record_response=self._before_record_response,
280-
decode_compressed_response=True
280+
decode_compressed_response=True,
281+
serializer='json'
281282
)
282283
self.my_vcr.register_matcher('custom', _custom_request_matcher)
283284
self.my_vcr.match_on = ['custom']
@@ -325,7 +326,6 @@ def _scrub_body_parameters(value):
325326
response['body'][key] = bytes(value, 'utf-8')
326327
except TypeError:
327328
response['body'][key] = value.encode('utf-8')
328-
329329
return response
330330

331331
@mock.patch('azure.cli.core.util.handle_exception', _mock_handle_exceptions)

0 commit comments

Comments
 (0)