teamclairvoyant / airflow-scheduler-failover-controller

A process that runs in unison with Apache Airflow to control the Scheduler process to ensure High Availability
Apache License 2.0
232 stars 58 forks source link

Convert to python3 #15

Closed bingdow closed 5 years ago

bingdow commented 5 years ago

Hi, I've converted it to python3; it worked like a charm. Basically, I just used a conversion tool: 2to3 and fixed a type conversion bug. I was thinking how would you like to maintain both python2 and python3 versions so that I will send a pull request if you want. Thanks.

Stormhand commented 5 years ago

Even if you run it under Python3 it throws an exception on ssh command run:

Traceback (most recent call last): File "/opt/airflow/venv36/bin/scheduler_failover_controller", line 7, in args.func(args) File "/var/opt/airflow/venv36/lib64/python3.6/site-packages/scheduler_failover_controller/bin/cli.py", line 98, in start logger=logger File "/var/opt/airflow/venv36/lib64/python3.6/site-packages/scheduler_failover_controller/app.py", line 35, in main failover_controller.poll() File "/var/opt/airflow/venv36/lib64/python3.6/site-packages/scheduler_failover_controller/failover/failover_controller.py", line 120, in poll if self.is_scheduler_running(standby_node): File "/var/opt/airflow/venv36/lib64/python3.6/site-packages/scheduler_failover_controller/failover/failover_controller.py", line 155, in is_scheduler_running if line.strip() != "" and process_check_command not in line and grep_command not in line and grep_command_no_quotes not in line and full_status_check_command not in line: TypeError: a bytes-like object is required, not 'str'

sudhakar-nallam commented 5 years ago

@Stormhand Have you tried testing this with the latest release v1.0.4?

Stormhand commented 5 years ago

No, i didnt notice you released 1.0.4 :)