-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Expose waiters in the CLI #985
Conversation
Add a ``wait`` command to all services that have waiters. For each type of waiter, a subcommand representing that waiter was added. For example, to wait for an ec2 instance to reach the running state, the wait command would be specified as ``aws ec2 wait instance-running``.
@@ -232,7 +232,16 @@ def doc_subitems_start(self, help_command, **kwargs): | |||
|
|||
def doc_subitem(self, command_name, help_command, **kwargs): | |||
doc = help_command.doc | |||
doc.style.tocitem(command_name) | |||
subcommand = help_command.command_table[command_name] | |||
subcommand_table = getattr(subcommand, 'subcommand_table', {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is based on the assumption that the commands that have even more commands, are a custom BasicCommand
. All custom commands have the subcommand_table
property. However, if we were stringing together ServiceCommand
and ServiceOperation
objects we will not be able to use this property because they have no such property (not even under a different name).
Overall I think this looks good. I like the approach, it was straightforward and easy to follow. The only two small things are figuring out if it's possible to have consistent event args and if we can add something to the client to avoid accessing internal attributes. |
Ready to get looked at again. I ran the integration tests and they pass as well. |
Looks good. |
* release-1.5.6: Bumping version to 1.5.6 Simplify DelegationSetId format Update CHANGELOG with new service features Revert "Merge pull request #985 from kyleknap/waiters" Update waiter code based on feedback Expose waiters in the CLI
Add a
wait
command to all services that have waiters. For each type ofwaiter, a subcommand representing that waiter was added. For example, to wait
for an ec2 instance to reach the running state, the wait command would be
specified as
aws ec2 wait instance-running
.With the CLI being in a weird transition state, there are some areas that I would like to improve on, but I believe changes to both the client interface and switching the clidriver over to clients need to be made first. I will point out these areas in the code. Let me know if you have any suggestions. Feedback on the places I point out would be very much welcomed.
cc @jamesls @danielgtaylor