Open jimstein3d opened 1 year ago
Unfortunately it's actually necessary to get space information even during a dry run: it's the only way to determine the ID of the top-level page in a space when using the --top-level
argument. Before version 2.1 that was done incorrectly. I could look into possibly not allowing that option during a dry run, or at least warning the user about it.
with this command line "md2cf --host 'https://\<my secret>.atlassian.net/wiki/rest/api' --username '\<my secret>' --password '\<my secret>' --space \<my secret> --dry-run --no-gitignore 'C:\my-project\docs'" and with "pip install md2cf==2.0.2" it will work. But if I then do this "pip install md2cf==2.1.0" and run the command line again I now get this error:
Traceback (most recent call last): File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "C:\Python311\Scripts\md2cf.exe__main.py", line 7, in
File "C:\Python311\Lib\site-packages\md2cf\ main__.py", line 384, in main
space_info = confluence.get_space(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\md2cf\api.py", line 259, in get_space
return self._get(f"content?spaceKey={space}/")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\md2cf\api.py", line 70, in _get
return self._request("GET", path, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\md2cf\api.py", line 66, in _request
r.raise_for_status()
File "C:\Python311\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://\<my secret>.atlassian.net/wiki/rest/api/space/\<my secret>/?expand=homepage
NOTE: this url (https://.atlassian.net/wiki/rest/api/space/\<my secret>/?expand=homepage) in the webbrowser print json content.
EDIT: the difference was that --dry-run is not respected in the new version. I still have problems with authentication credentials with the old version with --dry-run removed from command line.