Repository: fedora-infra/bodhi

Issue:
Modify the CLI to work with multiple content types
We will need to modify the CLI to handle multiple content types, once #1327 is done.


Discussion:
It's unclear to me what needs to happen here.

This should inherit the new output stuff added in #1327 which will *display* the content-type.

Maybe all we need is a cli switch to *search* for stuff by content-type?
Should be straightforward:

```diff
diff --git a/bodhi/client/__init__.py b/bodhi/client/__init__.py
index a03e6a5..6b99d4e 100644
--- a/bodhi/client/__init__.py
+++ b/bodhi/client/__init__.py
@@ -236,6 +236,8 @@ def edit(user, password, url, **kwargs):
               help='Query only critical path packages')
 @click.option('--cves', help='Query by CVE id')
 @click.option('--packages', help='Query by package name(s)')
+@click.option('--content-type', help='Query updates based on content type',
+              type=click.Choice(['rpm', 'module']))  # And someday, container.
 @click.option('--pushed', is_flag=True, default=None,
               help='Filter by pushed updates')
 @click.option('--pushed-since',
diff --git a/bodhi/tests/client/test___init__.py b/bodhi/tests/client/test___init__.py
index 6c24a1a..6982284 100644
--- a/bodhi/tests/client/test___init__.py
+++ b/bodhi/tests/client/test___init__.py
@@ -156,6 +156,7 @@ class TestQuery(unittest.TestCase):
             params={
                 'approved_since': None, 'status': None, 'locked': None,
                 'builds': u'nodejs-grunt-wrap-0.3.0-2.fc25', 'releases': None,
+                'content_type': None,
                 'submitted_since': None, 'suggest': None, 'request': None, 'bugs': None,
                 'staging': False, 'modified_since': None, 'pushed': None, 'pushed_since': None,
                 'user': None, 'critpath': None, 'updateid': None, 'packages': None, 'type': None,
```

Resolving patch:
diff --git a/bodhi/client/__init__.py b/bodhi/client/__init__.py
--- a/bodhi/client/__init__.py
+++ b/bodhi/client/__init__.py
@@ -236,6 +236,8 @@ def edit(user, password, url, **kwargs):
               help='Query only critical path packages')
 @click.option('--cves', help='Query by CVE id')
 @click.option('--packages', help='Query by package name(s)')
+@click.option('--content-type', help='Query updates based on content type',
+              type=click.Choice(['rpm', 'module']))  # And someday, container.
 @click.option('--pushed', is_flag=True, default=None,
               help='Filter by pushed updates')
 @click.option('--pushed-since',


Test patch:
diff --git a/bodhi/tests/client/test___init__.py b/bodhi/tests/client/test___init__.py
--- a/bodhi/tests/client/test___init__.py
+++ b/bodhi/tests/client/test___init__.py
@@ -156,6 +156,7 @@ def test_url_flag(self, send_request):
             params={
                 'approved_since': None, 'status': None, 'locked': None,
                 'builds': u'nodejs-grunt-wrap-0.3.0-2.fc25', 'releases': None,
+                'content_type': None,
                 'submitted_since': None, 'suggest': None, 'request': None, 'bugs': None,
                 'staging': False, 'modified_since': None, 'pushed': None, 'pushed_since': None,
                 'user': None, 'critpath': None, 'updateid': None, 'packages': None, 'type': None,