@@ -25,7 +25,8 @@ def swifturl2d(name, container_name, object_name):
2525
2626class 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):
5455class 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
8586class 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
123124class 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