Skip to content

Commit

Permalink
Fix bug where dictionary was accessed directly
Browse files Browse the repository at this point in the history
  • Loading branch information
bgklein committed Feb 15, 2019
1 parent c71701c commit b263506
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
SDK Release History
===================

5.0.2 (2019-02-15)
------------------

* Fix bug where apiVersion became required

5.0.1 (2019-02-15)
------------------

Expand Down
2 changes: 1 addition & 1 deletion azext/batch/operations/job_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def jobparameter_from_json(json_data):
result = 'JobTemplate' if json_data.get('properties') else 'ExtendedJobParameter'
try:
if result == 'JobTemplate':
if json_data['apiVersion']:
if json_data.get('apiVersion'):
max_datetime = dt.strptime(KnownTemplateVersion.Dec2018.value, "%Y-%m-%d")
specified_datetime = dt.strptime(json_data['apiVersion'], "%Y-%m-%d")
if max_datetime < specified_datetime:
Expand Down
2 changes: 1 addition & 1 deletion azext/batch/operations/pool_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def poolparameter_from_json(json_data):
result = 'PoolTemplate' if json_data.get('properties') else 'ExtendedPoolParameter'
try:
if result == 'PoolTemplate':
if json_data['apiVersion']:
if json_data.get('apiVersion'):
max_datetime = dt.strptime(KnownTemplateVersion.Dec2018.value, "%Y-%m-%d")
specified_datetime = dt.strptime(json_data['apiVersion'], "%Y-%m-%d")
if max_datetime < specified_datetime:
Expand Down
2 changes: 1 addition & 1 deletion azext/batch/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

VERSION = "5.0.1"
VERSION = "5.0.2"
1 change: 0 additions & 1 deletion tests/data/batch.job.simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
},
"job": {
"type": "Microsoft.Batch/batchAccounts/jobs",
"apiVersion": "2018-12-01",
"properties": {
"id": "[parameters('jobId')]",
"poolInfo": {
Expand Down
1 change: 0 additions & 1 deletion tests/data/batch.pool.simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
},
"pool": {
"type": "Microsoft.Batch/batchAccounts/pools",
"apiVersion": "2018-12-01",
"properties": {
"id": "[parameters('poolName')]",
"virtualMachineConfiguration": {
Expand Down

0 comments on commit b263506

Please sign in to comment.