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

Reserved Instance cli public PR #4838

Merged
merged 10 commits into from
Nov 8, 2017
Merged

Reserved Instance cli public PR #4838

merged 10 commits into from
Nov 8, 2017

Conversation

corquiri
Copy link
Contributor

@corquiri corquiri commented Nov 6, 2017


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

Command Guidelines

  • Each command and parameter has a meaningful description.
  • Each new command has a test.

(see Authoring Command Modules)

@azuresdkci
Copy link
Contributor

View a preview at https://prompt.ws/r/Azure/azure-cli/4838
This is an experimental preview for @microsoft.com users.
(It may take a minute or two for your instance to be ready)
Email feedback to 'azfeedback' with subject 'Prompt Feedback'.

@derekbekoe derekbekoe added this to the Sprint 26- Connect() milestone Nov 6, 2017
Copy link
Member

@derekbekoe derekbekoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • There's no help for several commands. e.g. az reservations -h. Help is required for all commands.
  • A lot of params don't have help text either.

Release History
===============

0.1.0 (2017-11-06)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the date. It's no longer required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use like other modules:

import pkg_resources
pkg_resources.declare_namespace(__name__)

Same with the other init files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

# --------------------------------------------------------------------------------------------

from azure.cli.core.help_files import helps
# pylint: disable=line-too-long
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this. None of the lines in this file is too long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted

type: string
- name: --reservation-id-1 -1
type: string
- name: --reservation-id-2 -2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a short summary for each of these parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary added for all parameters


def cli_reservation_update_reservation(client, reservation_order_id, reservation_id,
applied_scope_type, applied_scopes=None):
if applied_scopes is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if applied_scopes:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@corquiri
Copy link
Contributor Author

corquiri commented Nov 7, 2017

Got this error from CI build:
The following files should be added to doc_source_map.json:
src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/_help.py

So I added this line to doc/sphinx/azhelpgen/doc_source_map.json
leaving comment here because this file is not under reservations and I wanted to confirm that it's okay to modify this file

@troydai
Copy link
Contributor

troydai commented Nov 7, 2017

@derekbekoe this PR looks good to me. Besides the CI.

@@ -0,0 +1,7 @@
Microsoft Azure CLI 'reservations' Command Module
============================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The heading should be full length of the title.
CI may fail due to this.

def cli_reservation_split_reservation(client, reservation_order_id, reservation_id, quantity_1, quantity_2):
split = SplitRequest([quantity_1, quantity_2], create_resource_id(reservation_order_id, reservation_id))
x = client.split(reservation_order_id, split)
return x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just return client.split(reservation_order_id, split)?

def test_get_applied_reservation_order_ids(self):
result = self.cmd('az reservations reservation-order-id list --subscription-id 00000000-0000-0000-0000-000000000000').get_output_in_json()
for order_id in result['reservationOrderIds']['value']:
self.assertTrue('/providers/Microsoft.Capacity/reservationorders/' in order_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use self.assertIn. This would give a clearer error message on failure.
Similar elsewhere.
https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertIn

for order in reservation_order_list:
self._validate_reservation_order(order)
self.assertTrue('/providers/microsoft.capacity/reservationOrders/' in order['id'])
self.assertTrue(order['etag'] > 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertGreater(a, b)

@troydai troydai merged commit f061602 into Azure:dev Nov 8, 2017
LukaszStem pushed a commit to LukaszStem/azure-cli that referenced this pull request Nov 9, 2017
vmss: support basic tier of vms (Azure#4847)

Azure IoT CA functionality (Azure#4804)

* Adds support for X.509 Certificates in IoT Hub.

* Modifies release notes and changes help link.

* Cleans up .gitignore, and HISTORY.rst. Passes a single factory in commands.py. Moves test utilities. Adds a file completer.

* Updates style after rebase based on additional linter restrictions.

Reserved Instance cli public PR (Azure#4838)

Handle dashes in extension names better (Azure#4839)

Fix `az aks get-credentials` on Windows (Azure#4762)

* Fix `az aks get-credentials` on Windows

* Move k8s file merge logic to helper function

appservice: support assign managed service identity to webapp/functionapp (Azure#4837)

Extension examples small improvement (Azure#4852)

Fixing appservice list-locations (Azure#4846)

Add extension name to telemetry and UA header (Azure#4854)

Fix Azure#4825. (Azure#4853)

Extensions `az extension add` --yes param as flag (Azure#4858)

Fix issue Azure#2752. (Azure#4859)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants