Add debug
This commit is contained in:
parent
a9b53b884e
commit
7272d3dce8
1 changed files with 14 additions and 10 deletions
|
@ -589,6 +589,12 @@ r.status_code
|
||||||
post_obj['folder'] = self.get_folder_id(post_obj['folder'])
|
post_obj['folder'] = self.get_folder_id(post_obj['folder'])
|
||||||
if not self.exists_password(post_obj):
|
if not self.exists_password(post_obj):
|
||||||
try:
|
try:
|
||||||
|
safer_obj = post_obj
|
||||||
|
safer_obj['password'] = '***'
|
||||||
|
self._log.debug(
|
||||||
|
"Creating password: %s",
|
||||||
|
json.dumps(safer_obj, indent=2)
|
||||||
|
)
|
||||||
r = requests.post(
|
r = requests.post(
|
||||||
f'{self.http}://{self.host}/index.php/apps/passwords/api/1.0/password/create',
|
f'{self.http}://{self.host}/index.php/apps/passwords/api/1.0/password/create',
|
||||||
data=post_obj,
|
data=post_obj,
|
||||||
|
@ -629,7 +635,6 @@ r.status_code
|
||||||
|
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
return r.json()
|
return r.json()
|
||||||
else:
|
|
||||||
self._log.error(
|
self._log.error(
|
||||||
"Nextcloud instance returned status code: %s",
|
"Nextcloud instance returned status code: %s",
|
||||||
r.status_code
|
r.status_code
|
||||||
|
@ -655,7 +660,6 @@ r.status_code
|
||||||
|
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
return r.json()
|
return r.json()
|
||||||
else:
|
|
||||||
self._log.error(
|
self._log.error(
|
||||||
"Nextcloud instance returned status code: %s",
|
"Nextcloud instance returned status code: %s",
|
||||||
r.status_code
|
r.status_code
|
||||||
|
|
Loading…
Reference in a new issue