Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid syntax at python manage.py deploy #10

Closed
Andrej1A opened this issue Nov 27, 2018 · 3 comments
Closed

invalid syntax at python manage.py deploy #10

Andrej1A opened this issue Nov 27, 2018 · 3 comments

Comments

@Andrej1A
Copy link

I've followed the installation process and everything was prepared right on the target system with a clean Debian 9 machine. I've started the script out of my Mac OS X with Python 3.7.1 from my virtualenv.
After the fab bootstrap_ansible went through I've started the command python manage.py deploy and got the following error message:

(.env) ➜  src git:(master) ✗ python manage.py deploy 
Traceback (most recent call last):
  File "manage.py", line 13, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/django/core/management/__init__.py", line 216, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/django/core/management/__init__.py", line 36, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/underwear/management/commands/deploy.py", line 3, in <module>
    from underwear.run_underwear import deploy
  File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/underwear/run_underwear.py", line 64
    print "number of hosts: %s" % str(len(inventory.list_hosts()))
                              ^
SyntaxError: invalid syntax

I'm just a beginner with python, but after some research how to print a string with parameter it looks like the line:
print "number of hosts: %s" % str(len(inventory.list_hosts()))

should be look like the following line:
print("number of hosts: %(s)" % str(len(inventory.list_hosts())))

@danieltellez
Copy link

Hi Andre. The second syntax you refer is the Python3 one. The first syntax is for Python before 3. It looks like this package has no support for Python3.

@Andrej1A
Copy link
Author

Hi Daniel,
Thank you. I've just later seen that this tool is not up to date and the last commit is 4 years old.

@mattmakai
Copy link
Owner

yea sorry folks, i just don't have time to maintain this project :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants