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

Add 'pulp-smash shell' command. #1188

Merged
merged 1 commit into from
Mar 21, 2019

Conversation

rochacbruno
Copy link
Member

$ pulp-smash shell --help      
Usage: pulp-smash shell [OPTIONS]

  Run a Python shell with Pulp-Smash context.

  Start an interactive shell with pulp-smash objects available, if `ipython`
  is installed it will start ipython session, else it will start standard
  python shell.

Options:
  --ipython / --no-ipython
  --help                    Show this message and exit.
$ pulp-smash shell       
Welcome to Pulp-Smash interactive shell
	Auto imported: api, cli, config, utils, pulp2, pulp3, constants, exceptions
	Available objects: api.client, cli.client, cfg

In [1]: api.client.get('/pulp/api/v2/status/').json()
Out[1]: 
{'known_workers': [{'_ns': 'workers',
   'last_heartbeat': '2019-03-20T18:44:57Z',
   '_id': 'scheduler@rhel-76-pulp-2'},
  {'_ns': 'workers',
   'last_heartbeat': '2019-03-20T18:44:57Z',
   '_id': 'resource_manager@rhel-76-pulp-2'},
  {'_ns': 'workers',
   'last_heartbeat': '2019-03-20T18:44:54Z',
   '_id': 'reserved_resource_worker-0@rhel-76-pulp-2'}],
 'messaging_connection': {'connected': True},
 'database_connection': {'connected': True},
 'api_version': '2',
 'versions': {'platform_version': '2.19c1'}}

asciicast

@nixocio
Copy link

nixocio commented Mar 20, 2019

I like this idea. I will get back to this PR later.

@dralley
Copy link
Contributor

dralley commented Mar 21, 2019

Oh nice, that looks great!

Copy link
Contributor

@bherrin3 bherrin3 left a comment

Choose a reason for hiding this comment

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

That's awesome, but I think there is a subliminal message I should become vegan...

Copy link
Contributor

@ragabala ragabala left a comment

Choose a reason for hiding this comment

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

💯

@nixocio
Copy link

nixocio commented Mar 21, 2019

@rochacbruno, I would suggest to add your section demo as part of the docs. Great work to be not used.

@rochacbruno rochacbruno merged commit 75090c9 into pulp:master Mar 21, 2019
@rochacbruno rochacbruno deleted the pulp_smash_shell branch March 21, 2019 23:34
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.

None yet

5 participants