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

Upgrade the container/compute library to 0.32.0 #1233

Merged
merged 4 commits into from
Nov 7, 2016

Conversation

brendandburns
Copy link
Member

@tjprescott
Copy link
Member

It looks like there are some Pylint errors and at least one test (test_acs_create_update) needs to be re-recorded due to the SDK update.

@yugangw-msft
Copy link
Contributor

@brendandburns, please add a new test step for list in the test case and re-record

cli_command('acs list', ContainerServiceOperations.list, factory)
cli_command('acs delete', ContainerServiceOperations.delete, factory)
cli_command('acs show', ContainerServicesOperations.get, factory)
cli_command('acs list', list_container_services)
Copy link
Member

Choose a reason for hiding this comment

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

Change this to cli_command('acs list', list_container_services, factory) as line 114 already createes to container_services client.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@@ -1020,3 +1020,9 @@ def update_acs(resource_group_name, container_service_name, new_agent_count):
return client.container_service.create_or_update(resource_group_name,
container_service_name, instance)

def list_container_services(resource_group_name=None):
''' List Container Services. '''
ccf = _compute_client_factory()
Copy link
Member

Choose a reason for hiding this comment

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

... Then in this method:

  • Remove ccf = _compute_client_factory() and ccf.container_services
  • The first argument will now be the container service client.
def list_container_services(client, resource_group_name=None):
   svc_list = client.list_by_resource_group(resource_group_name=resource_group_name) \
       if resource_group_name else ccf.container_services.list()
    return list(svc_list)

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@brendandburns
Copy link
Member Author

comments addressed, ci/cd fixed (i hope), please take another look.

Thanks!

@yugangw-msft
Copy link
Contributor

there are lint errors still:

python -m pylint -d I0013 -r n /home/travis/build/Azure/azure-cli/src/command_modules/azure-cli-vm/azure
************* Module azure.cli.command_modules.vm.custom
C:1021, 0: Wrong continued indentation (add 1 space).
                                                     container_service_name, instance)
                                                     ^| (bad-continuation)
C:1025, 0: Line too long (106/100) (line-too-long)

@brendandburns
Copy link
Member Author

@yugangw-msft all passing now, sorry for the issues.

Thanks!
--brendan


def list_container_services(client, resource_group_name=None):
''' List Container Services. '''
svc_list = client.container_services.list_by_resource_group(
Copy link
Contributor

Choose a reason for hiding this comment

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

With your change at commands.py to reuse the factory object, the client now points to container_services already, so this line might be broken. Please double check. Also it won't hurt to invoke the list command in the e2e test case.
I usually avoid passing in operation_group object as client to custom commands, because of the inconsistency, hence confusing.

Copy link
Contributor

Choose a reason for hiding this comment

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

@brendandburns, see my comments above, please verify list still works

Copy link
Member Author

Choose a reason for hiding this comment

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

@yugangw-msft good catch, fixed.

How do I add it to the e2e test case?

Copy link
Contributor

@yugangw-msft yugangw-msft Nov 7, 2016

Choose a reason for hiding this comment

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

@brendandburns, add a test step here. I recently added similar testing for webapp. Yes, you need to delete and re-record VCR data.
Since people are waiting for this change, I went ahead and merged it. You can catch up the test coverage in the next PR

@yugangw-msft yugangw-msft merged commit eb316bc into Azure:master Nov 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants