Explorar el Código

AMBARI-12446. Starting ranger enabled services fails if folder to copy JDBC driver does not exist (Gautam Borad via smohanty)

Sumit Mohanty hace 10 años
padre
commit
1d644b457c

+ 8 - 0
ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py

@@ -50,6 +50,14 @@ def setup_ranger_plugin(component_select_name, service_name,
     content = DownloadSource(component_driver_curl_source)
     content = DownloadSource(component_driver_curl_source)
   )
   )
 
 
+  directory_path = os.path.dirname(component_driver_curl_target)
+
+  if not os.path.exists(directory_path):
+    Logger.info('Creating directory path {0}'.format(directory_path))
+    Directory(directory_path,
+      mode=0755
+    )
+
   Execute(('cp', '--remove-destination', component_downloaded_custom_connector, component_driver_curl_target),
   Execute(('cp', '--remove-destination', component_downloaded_custom_connector, component_driver_curl_target),
     not_if=format("test -f {component_driver_curl_target}"),
     not_if=format("test -f {component_driver_curl_target}"),
     sudo=True
     sudo=True