summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2013-12-30 11:44:25 -0500
committerDonald Stufft <donald@stufft.io>2013-12-31 13:31:47 -0500
commit16e929eb6a10dbfe49f667b6cd09ff214da797eb (patch)
tree73e9631dfcea24f27c3ad4c606b9147d73b6939b
parent9d67ba5899e55e25601e38c21692f082cb747346 (diff)
downloadpython-barbicanclient-16e929eb6a10dbfe49f667b6cd09ff214da797eb.tar.gz
Rename the command line client to barbican
Change-Id: I7695365dd5fe2504f3d267012ac6717790e97541
-rw-r--r--README.md18
-rw-r--r--barbicanclient/barbican.py (renamed from barbicanclient/keep.py)4
-rw-r--r--barbicanclient/test/test_barbican.py (renamed from barbicanclient/test/test_keep.py)14
-rw-r--r--setup.py9
4 files changed, 23 insertions, 22 deletions
diff --git a/README.md b/README.md
index 31ba7cb..0012ee6 100644
--- a/README.md
+++ b/README.md
@@ -2,11 +2,11 @@
This is a client for the [Barbican](https://github.com/stackforge/barbican)
Key Management API. There is a Python library for accessing the API
-(`barbicanclient` module), and a command-line script (`keep`).
+(`barbicanclient` module), and a command-line script (`barbican`).
## Installation
-The client is [pip installable](https://pypi.python.org/pypi/python-barbicanclient) as follows:
+The client is [pip installable](https://pypi.python.org/pypi/python-barbicanclient) as follows:
```bash
pip install python-barbicanclient
@@ -16,22 +16,22 @@ pip install python-barbicanclient
The full api is [documented in the wiki](https://github.com/cloudkeep/python-barbicanclient/wiki/Client-Usage).
-Here's an example of storing a secret in barbican using the python library
+Here's an example of storing a secret in barbican using the python library
with keystone authentication:
```python
>>> from barbicanclient.common import auth
>>> from barbicanclient import client
# We'll use keystone for authentication
->>> keystone = auth.KeystoneAuthV2(auth_url='http://keystone-int.cloudkeep.io:5000/v2.0',
+>>> keystone = auth.KeystoneAuthV2(auth_url='http://keystone-int.cloudkeep.io:5000/v2.0',
... username='USER', password='PASSWORD', tenant_name='TENANT')
>>> barbican = client.Client(auth_plugin=keystone)
# Let's store some sensitive data, Barbican encrypts it and stores it securely in the cloud
->>> secret_uri = barbican.secrets.store(name='Self destruction sequence',
-... payload='the magic words are squeamish ossifrage',
+>>> secret_uri = barbican.secrets.store(name='Self destruction sequence',
+... payload='the magic words are squeamish ossifrage',
... payload_content_type='text/plain')
# Let's look at some properties of a barbican Secret
>>> secret = barbican.secrets.get(secret_uri)
->>> print(secret.secret_ref)
+>>> print(secret.secret_ref)
u'http://api-01-int.cloudkeep.io:9311/v1/test_tenant/secrets/49496a6d-c674-4384-b208-7cf4988f84ee'
>>> print(secret.name)
Self destruction sequence
@@ -40,11 +40,11 @@ Self destruction sequence
the magic words are squeamish ossifrage
```
-## keep - Command Line Client
+## barbican - Command Line Client
Command line client configuration and usage is [documented in the wiki](https://github.com/cloudkeep/python-barbicanclient/wiki/Command-Line-Client).
```
-usage: keep [-h] [--no-auth | --os-auth-url <auth-url>]
+usage: barbican [-h] [--no-auth | --os-auth-url <auth-url>]
[--os-username <auth-user-name>] [--os-password <auth-password>]
[--os-tenant-name <auth-tenant-name>] [--os-tenant-id <tenant-id>]
[--endpoint <barbican-url>]
diff --git a/barbicanclient/keep.py b/barbicanclient/barbican.py
index 522ece3..e98a1b7 100644
--- a/barbicanclient/keep.py
+++ b/barbicanclient/barbican.py
@@ -24,7 +24,7 @@ from barbicanclient.openstack.common import log as logging
logging.setup('barbicanclient')
-class Keep:
+class Barbican:
def __init__(self):
self.parser = self._get_main_parser()
self.subparsers = self.parser.add_subparsers(
@@ -340,7 +340,7 @@ class Keep:
def main():
- k = Keep()
+ k = Barbican()
k.execute()
diff --git a/barbicanclient/test/test_keep.py b/barbicanclient/test/test_barbican.py
index 0bcdea6..c784ea3 100644
--- a/barbicanclient/test/test_keep.py
+++ b/barbicanclient/test/test_barbican.py
@@ -18,27 +18,27 @@ import os
import sys
import unittest2 as unittest
-import barbicanclient.keep
+import barbicanclient.barbican
def suite():
suite = unittest.TestSuite()
- suite.addTest(TestKeep())
+ suite.addTest(TestBarbican())
return suite
-class TestKeep(unittest.TestCase):
- def keep(self, argstr):
+class TestBarbican(unittest.TestCase):
+ def barbican(self, argstr):
"""Source: Keystone client's shell method in test_shell.py"""
orig = sys.stdout
clean_env = {}
_old_env, os.environ = os.environ, clean_env.copy()
try:
sys.stdout = cStringIO.StringIO()
- _keep = barbicanclient.keep.Keep()
- _keep.execute(argv=argstr.split())
+ _barbican = barbicanclient.barbican.Barbican()
+ _barbican.execute(argv=argstr.split())
except SystemExit:
exc_type, exc_value, exc_traceback = sys.exc_info()
self.assertEqual(exc_value.code, 0)
@@ -54,7 +54,7 @@ class TestKeep(unittest.TestCase):
def test_help(self):
args = "-h"
- self.assertIn('usage: ', self.keep(args))
+ self.assertIn('usage: ', self.barbican(args))
if __name__ == '__main__':
unittest.main()
diff --git a/setup.py b/setup.py
index 5216064..5e4fe76 100644
--- a/setup.py
+++ b/setup.py
@@ -71,8 +71,9 @@ setuptools.setup(
'Programming Language :: Python :: 2.7',
'Environment :: No Input/Output (Daemon)',
],
- entry_points="""
- [console_scripts]
- keep = barbicanclient.keep:main
- """
+ entry_points={
+ "console_scripts": [
+ "barbican = barbicanclient.barbican:main",
+ ],
+ },
)