Skip to content

Commit

Permalink
Respect V3IO_API and V3IO_ACCESS_KEY
Browse files Browse the repository at this point in the history
  • Loading branch information
pavius committed Apr 17, 2019
1 parent aa04a76 commit da439a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion v3io/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.0'
__version__ = '0.1.1'
8 changes: 4 additions & 4 deletions v3io/dataplane/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def __init__(self, logger, endpoints=None, max_connections=4, timeout=None):
def new_items_cursor(self, container_name, access_key, request_input):
return v3io.dataplane.items_cursor.ItemsCursor(self, container_name, access_key, request_input)

def new_session(self, access_key):
return v3io.dataplane.session.Session(self, access_key)
def new_session(self, access_key=None):
return v3io.dataplane.session.Session(self, access_key or os.environ['V3IO_ACCESS_KEY'])

def get_object(self, container_name, access_key, request_input):
return self._encode_and_http_request(container_name,
Expand Down Expand Up @@ -99,8 +99,8 @@ def _get_endpoints(self, endpoints):

if env_endpoints is not None:
endpoints = env_endpoints.split(',')

raise RuntimeError('Endpoints must be passed to context or specified in V3IO_API')
else:
raise RuntimeError('Endpoints must be passed to context or specified in V3IO_API')

endpoints_with_scheme = []

Expand Down
6 changes: 3 additions & 3 deletions v3io/dataplane/tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
class TestContainer(unittest.TestCase):

def setUp(self):
self._logger = v3io.logger.Logger('DEBUG')
self._logger = v3io.logger.Logger()
self._logger.set_handler('stdout', sys.stdout, v3io.logger.HumanReadableFormatter())

# create a context
context = v3io.dataplane.Context(self._logger, [os.environ['V3IO_DATAPLANE_URL']])
context = v3io.dataplane.Context(self._logger)

# create a session and container
self._container = context.new_session(os.environ['V3IO_DATAPLANE_ACCESS_KEY']).new_container('bigdata')
self._container = context.new_session().new_container('bigdata')

self._path = '/emd0'

Expand Down

0 comments on commit da439a0

Please sign in to comment.