princenyeche/jiraone

from: can't read /var/mail/jiraone

aubreyskingdom opened this issue · 8 comments

When I attempt to run from jiraone import LOGIN, USER and then add my information I am getting an error:

from: can't read /var/mail/jiraone
zsh: command not found: user
zsh: command not found: password
link: =: No such file or directory
zsh: unknown username 'er=u'

If you have python 3.6.x and above installed, then you will need to be on python shell on your terminal to run that command.

your_user@you~% python
Type "help", "copyright", "credits" or "license" for more information.
>>> from jiraone import LOGIN, USER
>>>

Thanks for the quick response. If I'm in the python shell I'm still getting an error:
Python 3.9.5 (default, May 3 2021, 19:12:05)
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from jiraone import LOGIN, USER
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'jiraone'

So then I thought I should install jiraone within the python shell and this is the result:

pip install jiraone
File "", line 1
pip install jiraone
^
SyntaxError: invalid syntax

I believe you need to install virtual environment first to do that

your_user@you~% python -m virtualenv venv

cd into the directory of your venv and activate it. You might be asked to upgrade pip and virtualenv, please follow your screen prompt to do that.

your_user@you~% source venv/bin/activate
(venv)your_user@you~% pip install jiraone
(venv)your_user@you~% python
Type "help", "copyright", "credits" or "license" for more information.
>>>

Hey @aubreyskingdom
How did your configuration go?

I've made a lot of progress! I was able to get into the virtual environment successfully and configure my login info. I am testing the usage of this by running this:
if name == 'main':
# the output of the file would be absolute to the directory where this python file is being executed from
USER.get_all_users(pull="active", user_type="atlassian", file="user_file.csv")

and this is the result I'm getting:
Current Record - At Row 50
Current Record - At Row 100
Current Record - At Row 150
Current Record - At Row 200
Traceback (most recent call last):
File "", line 3, in
File "/opt/homebrew/lib/python3.9/site-packages/jiraone/reporting.py", line 1139, in get_all_users
self.report(category=folder, filename=file)
File "/opt/homebrew/lib/python3.9/site-packages/jiraone/reporting.py", line 1144, in report
file_writer(folder=category, file_name=filename, data=read, mark="many")
File "/opt/homebrew/lib/python3.9/site-packages/jiraone/reporting.py", line 1265, in file_writer
file = path_builder(path=folder, file_name=file_name)
File "/opt/homebrew/lib/python3.9/site-packages/jiraone/reporting.py", line 1254, in path_builder
base_dir = os.path.join(WORK_PATH, path)
File "/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/posixpath.py", line 90, in join
genericpath._check_arg_types('join', a, *p)
File "/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/genericpath.py", line 152, in _check_arg_types
raise TypeError(f'{funcname}() argument must be str, bytes, or '
TypeError: join() argument must be str, bytes, or os.PathLike object, not '_SpecialForm'

Hey @aubreyskingdom
I think the problem might be with the path to the file. Can you try the below by adding the folder path

USER.get_all_users(pull="active", user_type="atlassian", file="user_file.csv", folder="Test_Folder")

Hi @aubreyskingdom
Hope the above helps!

If all is okay, I will be closing off this issue.