Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where dictionary was accessed directly #98

Merged
merged 1 commit into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix bug where dictionary was accessed directly
  • Loading branch information
bgklein committed Feb 19, 2019
commit 59d6328071053deeb967bc449ebee8acd1eecfca
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 'apiVersion' in json_data:
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 'apiVersion' in json_data:
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