Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _add_dynamic_library_in_path(self, lib_dir):
for f in os.listdir(lib_dir):
file_path = os.path.join(lib_dir, f)
if os.path.isfile(file_path):
logger.debug("LIB: %s" % file_path)
self._resource.add_dynamic_library(file_path)
def _force_delete_file(self, path):
toft_path = self._toft_path(path)
if toft_path.startswith('/hdfs/'):
self._hadoop_client().fs_rmr(path, self._hadoop_config)
return True
else:
try:
logger.debug('rmtree %s' % path)
shutil.rmtree(path)
except Exception as e:
logger.warning('%s' % e)
return not os.path.exists(path)