Skip to content

Commit ac3b38b

Browse files
author
Adam Cox
committed
Adds option to set public configuration.
Bumps version number to 0.0.2.
1 parent 3979eee commit ac3b38b

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.0.2 (2016-07-18)
2+
====================
3+
4+
- [NEW] Adds option to set 'public' configuration during instantiation.
5+
16
0.0.1 (2016-05-17)
27
====================
38

ibmos2spark/__info__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
__version__ = '0.0.1'
16+
__version__ = '0.0.2'

ibmos2spark/osconfig.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def swifturl2d(name, container_name, object_name):
2525

2626
class softlayer(object):
2727

28-
def __init__(self, sparkcontext, name, auth_url, username, password):
28+
def __init__(self, sparkcontext, name, auth_url, username, password,
29+
public=False):
2930
'''
3031
sparkcontext is a SparkContext object.
3132
name is a string that can be anything other than an empty string.
@@ -43,7 +44,7 @@ def __init__(self, sparkcontext, name, auth_url, username, password):
4344
hconf.set(prefix + ".auth.endpoint.prefix", "endpoints")
4445
hconf.setInt(prefix + ".http.port", 8080)
4546
hconf.set(prefix + ".apikey", password)
46-
hconf.setBoolean(prefix + ".public", True)
47+
hconf.setBoolean(prefix + ".public", public)
4748
hconf.set(prefix + ".use.get.auth", "true")
4849
hconf.setBoolean(prefix + ".location-aware", False)
4950
hconf.set(prefix + ".password", password)
@@ -54,7 +55,7 @@ def url(self, container_name, object_name):
5455
class softlayer2d(object):
5556

5657
def __init__(self, sparkcontext, name, auth_url, tenant, username, password,
57-
swift2d_driver='com.ibm.stocator.fs.ObjectStoreFileSystem'):
58+
swift2d_driver='com.ibm.stocator.fs.ObjectStoreFileSystem', public=False):
5859
'''
5960
sparkcontext is a SparkContext object.
6061
name is a string that can be anything other than an empty string.
@@ -74,7 +75,7 @@ def __init__(self, sparkcontext, name, auth_url, tenant, username, password,
7475
hconf.set(prefix + ".auth.method", "swiftauth")
7576
hconf.setInt(prefix + ".http.port", 8080)
7677
hconf.set(prefix + ".apikey", password)
77-
hconf.setBoolean(prefix + ".public", True)
78+
hconf.setBoolean(prefix + ".public", public)
7879
hconf.set(prefix + ".use.get.auth", "true")
7980
hconf.setBoolean(prefix + ".location-aware", False)
8081
hconf.set(prefix + ".password", password)
@@ -84,7 +85,7 @@ def url(self, container_name, object_name):
8485

8586
class bluemix(object):
8687

87-
def __init__(self, sparkcontext, credentials):
88+
def __init__(self, sparkcontext, credentials, public=False):
8889
'''
8990
sparkcontext is a SparkContext object.
9091
@@ -115,15 +116,16 @@ def __init__(self, sparkcontext, credentials):
115116
hconf.set(prefix + ".password", credentials['password'])
116117
hconf.setInt(prefix + ".http.port", 8080)
117118
hconf.set(prefix + ".region", credentials['region'])
118-
hconf.setBoolean(prefix + ".public", True)
119+
hconf.setBoolean(prefix + ".public", False)
119120

120121
def url(self, container_name, object_name):
121122
return swifturl(self.name, container_name, object_name)
122123

123124
class bluemix2d(object):
124125

125126
def __init__(self, sparkcontext, credentials,
126-
swift2d_driver='com.ibm.stocator.fs.ObjectStoreFileSystem'):
127+
swift2d_driver='com.ibm.stocator.fs.ObjectStoreFileSystem',
128+
public=False):
127129
'''
128130
sparkcontext is a SparkContext object.
129131
@@ -156,7 +158,7 @@ def __init__(self, sparkcontext, credentials,
156158
hconf.set(prefix + ".password", credentials['password'])
157159
hconf.setInt(prefix + ".http.port", 8080)
158160
hconf.set(prefix + ".region", credentials['region'])
159-
hconf.setBoolean(prefix + ".public", True)
161+
hconf.setBoolean(prefix + ".public", public)
160162

161163
def url(self, container_name, object_name):
162164
return swifturl2d(self.name, container_name, object_name)

0 commit comments

Comments
 (0)