Skip to content

Commit 1b5d457

Browse files
author
gadamc
committed
Adds __info__.py module and small update to the comment on bluemix object.
1 parent db1b16a commit 1b5d457

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

ibmos2spark/__info__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env python
2+
# Copyright (c) 2016 IBM. All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
__version__ = '0.0.1b0'

ibmos2spark/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"""
1616
Helper to connect to Softlayer and Bluemix ObjectStore from IBM Spark Service
1717
"""
18-
__version__ = '0.0.1a1'
19-
18+
from .__info__ import __version__
2019
from osconfig import softlayer, bluemix, softlayer2d, bluemix2d
2120

ibmos2spark/osconfig.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,13 @@ def __init__(self, sparkcontext, credentials):
8787
sparkcontext is a SparkContext object.
8888
8989
credentials is a dictionary with the following required keys:
90-
name
90+
9191
auth_url
9292
project_id
9393
user_id
9494
password
9595
region
96+
name #can be any string you choose
9697
9798
When using this from a IBM Spark service instance that
9899
is configured to connect to particular Bluemix object store
@@ -104,8 +105,9 @@ def __init__(self, sparkcontext, credentials):
104105

105106
prefix = "fs.swift.service." + credentials['name']
106107
hconf = sparkcontext._jsc.hadoopConfiguration()
107-
hconf.set(prefix + ".auth.url", credentials['auth_url']+'/v2.0/tokens')
108+
hconf.set(prefix + ".auth.url", credentials['auth_url']+'/v3/auth/tokens')
108109
hconf.set(prefix + ".auth.endpoint.prefix", "endpoints")
110+
hconf.set(prefix + ".auth.method","keystoneV3 ")
109111
hconf.set(prefix + ".tenant", credentials['project_id'])
110112
hconf.set(prefix + ".username", credentials['user_id'])
111113
hconf.set(prefix + ".password", credentials['password'])
@@ -123,12 +125,13 @@ def __init__(self, sparkcontext, credentials):
123125
sparkcontext is a SparkContext object.
124126
125127
credentials is a dictionary with the following required keys:
126-
name
128+
127129
auth_url
128130
project_id
129131
user_id
130132
password
131133
region
134+
name #can be any string you choose
132135
133136
When using this from a IBM Spark service instance that
134137
is configured to connect to particular Bluemix object store

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121

2222
from setuptools import setup, find_packages
2323

24+
from ibmos2spark.__info__ import __version__
2425

2526
setup_args = {
2627
'description': 'Helper tool to access Softlayer Object Store',
2728
'include_package_data': True,
2829
'install_requires': [],
2930
'name': 'ibmos2spark',
30-
'version': '0.0.1b0',
31+
'version': __version__,
3132
'author': 'gadamc',
3233
'author_email': '[email protected]',
3334
'url': 'https://github.com/gadamc/ibmos2spark',

0 commit comments

Comments
 (0)