diff --git a/almdrlib/__init__.py b/almdrlib/__init__.py index c6d4742..148d7e6 100644 --- a/almdrlib/__init__.py +++ b/almdrlib/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.0.26' +__version__ = '1.0.27' __author__ = 'Alert Logic, Inc.' import logging @@ -52,6 +52,7 @@ def client(service_name, version=None, session=None, *args, **kwargs): session = _get_default_session() return session.client(service_name, version, *args, **kwargs) + def configure( profile=almdrlib.constants.DEFAULT_PROFILE, access_key_id=None, secret_key=None, @@ -63,7 +64,6 @@ def configure( global_endpoint=global_endpoint, residency=residency) - # Logging to dev/null # http://docs.python.org/3.3/howto/logging.html#configuring-logging-for-a-library class NullHandler(logging.Handler): diff --git a/almdrlib/client.py b/almdrlib/client.py index 11e27d2..f8d4a28 100644 --- a/almdrlib/client.py +++ b/almdrlib/client.py @@ -297,7 +297,7 @@ def serialize(self, kwargs, headers=None): if self._explode: kwargs['data'] = json.dumps(result.pop(self.name)) else: - kwargs['data'] = json.dumps({self.name: result}) + kwargs['data'] = json.dumps(result) @property def schema(self): diff --git a/almdrlib/config.py b/almdrlib/config.py index ab1f0c9..ddaf761 100644 --- a/almdrlib/config.py +++ b/almdrlib/config.py @@ -4,6 +4,7 @@ import configparser import logging import almdrlib.constants +from almdrlib.exceptions import AlmdrlibValueError logger = logging.getLogger(__name__) @@ -154,10 +155,10 @@ def configure( try: parser.add_section(profile) - except configparser.DuplicateSectionError as e: + except configparser.DuplicateSectionError: # section alread exists. pass - except configparser.ValueError as e: + except configparser.ValueError: # almdrlib.constants.DEFAULT_PROFILE was passed as the section name pass diff --git a/almdrlib/constants.py b/almdrlib/constants.py index 5c0796a..ec57199 100644 --- a/almdrlib/constants.py +++ b/almdrlib/constants.py @@ -2,7 +2,7 @@ import os.path -DEFAULT_CONFIG_DIR = os.path.join(os.path.expanduser("~"), ".alertlogic") +DEFAULT_CONFIG_DIR = os.path.join(os.path.expanduser("~"), ".alertlogic") DEFAULT_CONFIG_FILE = os.path.join(DEFAULT_CONFIG_DIR, "config") DEFAULT_CREDENTIALS_FILE = os.path.join(DEFAULT_CONFIG_DIR, "credentials") DEFAULT_PROFILE = "default" diff --git a/almdrlib/docs/service.py b/almdrlib/docs/service.py index 4902c8c..fe1307f 100644 --- a/almdrlib/docs/service.py +++ b/almdrlib/docs/service.py @@ -3,7 +3,7 @@ import itertools try: from m2r import convert -except Exception as e: +except Exception: def convert(text): return text