File tree 3 files changed +26
-25
lines changed
3 files changed +26
-25
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,8 @@ def version(debug=False):
393
393
if debug :
394
394
print ("HPECP Bin Path: " + os .path .dirname (os .path .abspath (__file__ )))
395
395
print (
396
- "HPECP Lib Path: " + os .path .dirname (os .path .abspath (hpecp .__file__ ))
396
+ "HPECP Lib Path: "
397
+ + os .path .dirname (os .path .abspath (hpecp .__file__ ))
397
398
)
398
399
print ("Python Version: " + sys .version .replace ("\n " , "" ))
399
400
print ("Python Exe Path: " + sys .executable )
Original file line number Diff line number Diff line change @@ -368,18 +368,26 @@ def import_generic_cluster_with_json(
368
368
------
369
369
APIException
370
370
"""
371
- # assert (
372
- # json_file_path is not None or json_content is not None
373
- # ), "Either --json-file-path or --json-content must be provided. "
371
+ assert (
372
+ json_file_path is not None or json_content is not None
373
+ ), "Either --json-file-path or --json-content must be provided"
374
374
375
- # assert (
376
- # json_file_path is None and json_content is None
377
- # ), "Either --json-file-path or --json-content must be provided."
375
+ assert (
376
+ json_file_path is None or json_content is None
377
+ ), "Either --json-file-path or --json-content must be provided."
378
378
379
379
if json_file_path :
380
- # TODO verify file exist, etc
381
- with open (json_file_path , "r" ) as f :
382
- json_content = f .read ()
380
+ try :
381
+ with open (json_file_path , "r" ) as f :
382
+ json_content = f .read ()
383
+ except OSError :
384
+ print (
385
+ "Could not open/read json-file-path: {}" .format (
386
+ json_file_path
387
+ ),
388
+ file = sys .stderr ,
389
+ )
390
+ sys .exit (1 )
383
391
384
392
json_content = json .loads (json_content )
385
393
Original file line number Diff line number Diff line change @@ -153,28 +153,23 @@ def create_hdfs_with_kerberos(
153
153
[description]
154
154
keytab : [type]
155
155
[description]
156
- service_id : [type]
157
- [description]
158
156
backup_host : [type]
159
157
[description]
160
- endpoint_type : [type]
158
+ type : [type]
161
159
[description]
162
- endpoint_port : [type]
160
+ port : [type]
163
161
[description]
164
162
read_only : [type]
165
163
[description]
166
164
"""
167
165
_data = {
168
- "bdfs_root" : {
169
- #"path_from_endpoint": path_from_endpoint
170
- },
166
+ "bdfs_root" : {},
171
167
"endpoint" : {
172
168
"kdc_data" : [
173
169
{
174
- "host" : kdc_data_host ,
175
- #"port": kdc_data_port
176
- }
177
- ],
170
+ "host" : kdc_data_host ,
171
+ }
172
+ ],
178
173
"realm" : realm ,
179
174
"client_principal" : client_principal ,
180
175
"browse_only" : browse_only ,
@@ -188,16 +183,13 @@ def create_hdfs_with_kerberos(
188
183
"flags" : {"read_only" : read_only },
189
184
"label" : {"name" : name , "description" : description },
190
185
}
191
-
186
+
192
187
if path_from_endpoint != "" :
193
188
_data ["bdfs_root" ]["path_from_endpoint" ] = path_from_endpoint
194
189
195
190
if kdc_data_port != "" :
196
191
_data ["endpoint" ]["kdc_data" ]["kdc_data_port" ] = kdc_data_port
197
192
198
- #if keytab != "":
199
- # _data["endpoint"]["keytab"] = keytab
200
-
201
193
self .client ._request (
202
194
url = DatatapController .base_resource_path ,
203
195
http_method = "post" ,
You can’t perform that action at this time.
0 commit comments