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

Python3 지원을 위한 방안 필요 #43

Open
SuhwanJang opened this issue Mar 24, 2020 · 1 comment
Open

Python3 지원을 위한 방안 필요 #43

SuhwanJang opened this issue Mar 24, 2020 · 1 comment
Assignees

Comments

@SuhwanJang
Copy link
Contributor

SuhwanJang commented Mar 24, 2020

Python3 환경에서 빌드 시 에러는 나지 않지만, arcus.sh 명령 수행 시 에러가 발생한다.

[jam2in@docker-desktop scripts]$ ./arcus.sh zookeeper init
Traceback (most recent call last):
  File "/home/jam2in/arcus/scripts/fab", line 11, in <module>
    load_entry_point('fabric==2.5.0', 'console_scripts', 'fab')()
  File "/home/jam2in/arcus/lib/python/site-packages/invoke-1.4.1-py3.6.egg/invoke/program.py", line 373, in run
    self.parse_collection()
  File "/home/jam2in/arcus/lib/python/site-packages/invoke-1.4.1-py3.6.egg/invoke/program.py", line 465, in parse_collection
    self.load_collection()
  File "/home/jam2in/arcus/lib/python/site-packages/fabric-2.5.0-py3.6.egg/fabric/main.py", line 87, in load_collection
    super(Fab, self).load_collection()
  File "/home/jam2in/arcus/lib/python/site-packages/invoke-1.4.1-py3.6.egg/invoke/program.py", line 696, in load_collection
    module, parent = loader.load(coll_name)
  File "/home/jam2in/arcus/lib/python/site-packages/invoke-1.4.1-py3.6.egg/invoke/loader.py", line 76, in load
    module = imp.load_module(name, fd, path, desc)
  File "/usr/lib64/python3.6/imp.py", line 235, in load_module
    return load_source(name, filename, file)
  File "/usr/lib64/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 674, in exec_module
  File "<frozen importlib._bootstrap_external>", line 781, in get_code
  File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/jam2in/arcus/scripts/fabfile.py", line 135
    print destination, os.path.isfile(destination)
                    ^
SyntaxError: invalid syntax

현재 fabfile.py 에서 fabric 1.x version api를 사용하고 있는데,

from fabric.api import *
from fabric.colors import *
from fabric.contrib.files import *
from fabric.contrib.project import *
from fabric.task_utils import merge

fabric version 2.0 이후로 위 api 들은 사라지거나 다른 api로 변경되었다. 참고 : https://github.com/fabric/fabric/tree/2.0/fabric
https://github.com/fabric/fabric/tree/1.14/fabric

python3 환경에서 사용할 수 있는 fabric version 은 2.0 이상을 요구하기 때문에 fabric 2.0 api 를 사용하도록 변경해야 한다. 하지만 fabric 2.0 이상부터는 python 2.6을 지원하지 않아 python 2.6 환경에서 arcus를 사용하고 있는 곳이 있기 때문에 이 작업을 진행하기에 제한사항이 있다.

최소 python 2.6 이상 & 3 모두 지원할 수 있는 방안 탐색이 필요하다.

@computerphilosopher
Copy link
Contributor

computerphilosopher commented May 16, 2022

@SuhwanJang @jhpark816

검토 결과 fabric 1.x와 2.x의 API 변화가 심해서 거의 새로 만드는 수준으로 고쳐야 합니다.

제 생각에는 fabric 2.x로 갈아타는 것 보다 Ansible과 같은 다른 도구를 쓰는 방안이 나아보입니다.

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