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 a CLI helper #66

Merged
merged 1 commit into from
Jan 15, 2016
Merged

Add a CLI helper #66

merged 1 commit into from
Jan 15, 2016

Conversation

Ichimonji10
Copy link
Contributor

Add, document and test module pulp_smash.cli. This module provides "tools for
working with Pulp's CLI." This fixes #32:

It'd be nice if we could inspect the state of remote systems under test. For
example, it may be useful to log in to a remote system and determine whether
certain files are lying around in certain places in the file system.

Here's a simple example of how to use the new module:

>>> from pulp_smash import cli, config
>>> server_config = config.ServerConfig('localhost')
>>> client = cli.Client(server_config)
>>> response = client.run(('echo', '-n', 'foo'))
>>> response.returncode == 0
True
>>> response.stdout == 'foo'
True
>>> response.stderr == ''
True

The Client class is flexible enough that both request and response handling
can be customized on a per-instance basis. See the docstrings in module
pulp_smash.cli for details.

Add "plumbum" as a dependency. It is used by the CLI helper.

Many thanks to @elyezer for help in brainstorming a solution to this issue.

This commit does not affect test results (107 tests):

============  =============================
Pulp Version  Test Suite Results
============  =============================
2.7           OK
dev (2.8)     FAILED (errors=2, skipped=13)
============  =============================

@Ichimonji10
Copy link
Contributor Author

@bmbouter

`pulp_smash.cli`
================

Location: :doc:`/index` → :doc:`/api` → :doc:`/api/pulp_smash.cli`
Copy link
Contributor

Choose a reason for hiding this comment

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

Breadcrumbs++

@bmbouter
Copy link
Member

Does this need any representation in the docs or do the docstrings create the docs? If not, I think the docstring examples can be moved into the docs or have the docs build from them so we don't duplicate them.

@Ichimonji10
Copy link
Contributor Author

The documentation is built directly from the docstrings.

@elyezer
Copy link
Contributor

elyezer commented Jan 15, 2016

The travis failure is ./pulp_smash/cli.py:7:1: F401 'warnings' imported but unused.

Add, document and test module `pulp_smash.cli`. This module provides "tools for
working with Pulp's CLI." This fixes #32:

> It'd be nice if we could inspect the state of remote systems under test. For
> example, it may be useful to log in to a remote system and determine whether
> certain files are lying around in certain places in the file system.

Here's a simple example of how to use the new module:

    >>> from pulp_smash import cli, config
    >>> server_config = config.ServerConfig('localhost')
    >>> client = cli.Client(server_config)
    >>> response = client.run(('echo', '-n', 'foo'))
    >>> response.returncode == 0
    True
    >>> response.stdout == 'foo'
    True
    >>> response.stderr == ''
    True

The `Client` class is flexible enough that both request and response handling
can be customized on a per-instance basis. See the docstrings in module
`pulp_smash.cli` for details.

Add "plumbum" as a dependency. It is used by the CLI helper.

Many thanks to @elyezer for help in brainstorming a solution to this issue.

This commit does not affect test results (107 tests):

    ============  =============================
    Pulp Version  Test Suite Results
    ============  =============================
    2.7           OK
    dev (2.8)     FAILED (errors=2, skipped=13)
    ============  =============================
@Ichimonji10
Copy link
Contributor Author

Updated.

@elyezer
Copy link
Contributor

elyezer commented Jan 15, 2016

ACK

@bmbouter
Copy link
Member

This looks good to me. +1 to merging it.

@Ichimonji10 Ichimonji10 merged commit 7a5c342 into pulp:master Jan 15, 2016
@Ichimonji10 Ichimonji10 deleted the cli branch January 15, 2016 16:01
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.

Add ability to inspect remote system's state
3 participants