@@ -65,7 +65,7 @@ def stat(self, auth_token: tuple, resource: Resource) -> cs3spr.ResourceInfo:
6565 tend = time .time ()
6666 self ._status_code_handler .handle_errors (res .status , "stat" , resource .get_file_ref_str ())
6767 self ._log .info (
68- f'msg="Invoked Stat" fileref="{ resource .ref } " { resource .get_file_ref_str ()} trace="{ res .status .trace } " '
68+ f'msg="Invoked Stat" fileref="{ resource .ref } " { resource .get_file_ref_str ()} trace="{ res .status .trace } " '
6969 f'elapsedTimems="{ (tend - tstart ) * 1000 :.1f} "'
7070 )
7171 return res .info
@@ -240,6 +240,8 @@ def write_file(
240240 verify = self ._config .ssl_verify ,
241241 timeout = self ._config .http_timeout ,
242242 )
243+
244+
243245 except requests .exceptions .RequestException as e :
244246 self ._log .error (f'msg="Exception when uploading file to Reva" reason="{ e } "' )
245247 raise IOError (e ) from e
@@ -265,12 +267,13 @@ def write_file(
265267 return
266268
267269 self ._log .error (
268- f'msg="Error uploading file" code="{ putres .status_code } " reason="{ putres .reason } "'
270+ f'msg="Error uploading file" code="{ putres .status_code } " reason="{ putres .reason } " headers=" { headers } " '
269271 )
270272 raise IOError (putres .reason )
271273 self ._log .info (
272274 f'msg="File written successfully" { resource .get_file_ref_str ()} '
273- f'elapsedTimems="{ (tend - tstart ) * 1000 :.1f} "'
275+ f'elapsedTimems="{ (tend - tstart ) * 1000 :.1f} " '
276+ f'headers="{ headers } "'
274277 )
275278
276279 def read_file (self , auth_token : tuple , resource : Resource , lock_id : Optional [str ] = None ) -> Generator [bytes , None , None ]:
@@ -377,7 +380,7 @@ def _set_lock_using_xattr(self, auth_token, resource: Resource, app_name: str, l
377380 :raises: AuthenticationException (Authentication Failed)
378381 :raises: UnknownException (Unknown Error)
379382 """
380- self ._log .debug (f'msg="Using xattrs to execute SetLock" { resource .get_file_ref_str ()} " value="{ lock_id } "' )
383+ self ._log .debug (f'msg="Using xattrs to execute SetLock" { resource .get_file_ref_str ()} value="{ lock_id } "' )
381384 try :
382385 # The stat can raise a KeyError if the metadata (lock) attribute has not been set yet
383386 # e.g. the file is not locked
@@ -421,8 +424,8 @@ def set_lock(self, auth_token: tuple, resource: Resource, app_name: str, lock_id
421424 return
422425
423426 self ._status_code_handler .handle_errors (res .status , "set lock" , resource .get_file_ref_str ())
424- self ._log .debug (f'msg="Invoked SetLock" { resource .get_file_ref_str ()} " '
425- f'value="{ lock_id } result="{ res .status .trace } "' )
427+ self ._log .debug (f'msg="Invoked SetLock" { resource .get_file_ref_str ()} '
428+ f'value="{ lock_id } " result="{ res .status .trace } "' )
426429
427430 def _get_lock_using_xattr (self , auth_token : tuple , resource : Resource ) -> dict :
428431 """
@@ -436,7 +439,7 @@ def _get_lock_using_xattr(self, auth_token: tuple, resource: Resource) -> dict:
436439 :raises: AuthenticationException (Authentication Failed)
437440 :raises: UnknownException (Unknown Error)
438441 """
439- self ._log .debug (f'msg="Using xattrs to execute getlock" { resource .get_file_ref_str ()} " ' )
442+ self ._log .debug (f'msg="Using xattrs to execute getlock" { resource .get_file_ref_str ()} ' )
440443 try :
441444 currvalue = self .stat (auth_token , resource ).arbitrary_metadata .metadata [LOCK_ATTR_KEY ]
442445 values = currvalue .split ("!" )
@@ -475,7 +478,7 @@ def get_lock(self, auth_token: tuple, resource: Resource) -> Union[cs3spr.Lock,
475478 return self ._get_lock_using_xattr (auth_token , resource )
476479
477480 self ._status_code_handler .handle_errors (res .status , "get lock" , resource .get_file_ref_str ())
478- self ._log .debug (f'msg="Invoked GetLock" { resource .get_file_ref_str ()} " result="{ res .status .trace } "' )
481+ self ._log .debug (f'msg="Invoked GetLock" { resource .get_file_ref_str ()} result="{ res .status .trace } "' )
479482
480483 # rebuild a dict corresponding to the internal JSON structure used by Reva
481484 return {
@@ -508,7 +511,7 @@ def _refresh_lock_using_xattr(
508511 :raises: AuthenticationException (Authentication Failed)
509512 :raises: UnknownException (Unknown Error)
510513 """
511- self ._log .debug (f'msg="Using xattrs to execute RefreshLock" { resource .get_file_ref_str ()} " value="{ lock_id } "' )
514+ self ._log .debug (f'msg="Using xattrs to execute RefreshLock" { resource .get_file_ref_str ()} value="{ lock_id } "' )
512515 try :
513516 # The stat can raise a KeyError if the metadata (lock) attribute has not been set yet
514517 # e.g. the file is not locked
@@ -517,7 +520,7 @@ def _refresh_lock_using_xattr(
517520 if values [0 ] == app_name and (not existing_lock_id or values [1 ] == existing_lock_id ):
518521 raise KeyError
519522 self ._log .info (
520- f'Failed precondition on RefreshLock" { resource .get_file_ref_str ()} " appname="{ app_name } " '
523+ f'Failed precondition on RefreshLock" { resource .get_file_ref_str ()} appname="{ app_name } " '
521524 f'value="{ lock_id } previouslock="{ currvalue } "'
522525 )
523526 raise FileLockedException ()
@@ -583,7 +586,7 @@ def _unlock_using_xattr(
583586 :raises: AuthenticationException (Authentication Failed)
584587 :raises: UnknownException (Unknown Error)
585588 """
586- self ._log .debug (f'msg="Using xattrs to execute unlock" { resource .get_file_ref_str ()} " value="{ lock_id } "' )
589+ self ._log .debug (f'msg="Using xattrs to execute unlock" { resource .get_file_ref_str ()} value="{ lock_id } "' )
587590 try :
588591 # The stat can raise a KeyError if the metadata (lock) attribute has not been set yet
589592 # e.g. the file is not locked
@@ -592,7 +595,7 @@ def _unlock_using_xattr(
592595 if values [0 ] == app_name and values [1 ] == lock_id :
593596 raise KeyError
594597 self ._log .info (
595- f'Failed precondition on unlock" { resource .get_file_ref_str ()} " appname="{ app_name } " '
598+ f'Failed precondition on unlock" { resource .get_file_ref_str ()} appname="{ app_name } " '
596599 f'value={ lock_id } previouslock="{ currvalue } "'
597600 )
598601 raise FileLockedException ()
0 commit comments