Coverage for airflow.hooks.samba_hook : 39%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
''' Allows for interaction with an samba server. '''
self.conn = self.get_connection(samba_conn_id)
samba = SambaClient( server=self.conn.host, share=self.conn.schema, username=self.conn.login, ip=self.conn.host, password=self.conn.password) return samba
samba = self.get_conn() if samba.exists(destination_filepath): if samba.isfile(destination_filepath): samba.remove(destination_filepath) else: folder = os.path.dirname(destination_filepath) if not samba.exists(folder): samba.mkdir(folder) samba.upload(local_filepath, destination_filepath) |