Compare commits

..

3 Commits

Author SHA1 Message Date
dw-0
6178e7100d Merge 63cae491f3 into a374ac8fac 2024-05-11 12:29:33 +02:00
dw-0
63cae491f3 refactor: update .gitignore
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
2024-05-11 12:27:54 +02:00
Patrick Gehrsitz
05b5664062 fix: fix crowsnest installer (#470)
* fix: fix crowsnest installer

Signed-off-by: mryel00 <mryel00.github@gmail.com>

* chore: remove unnecessary code

This check is made inside the called tool too. Therefore removing it here.

Signed-off-by: mryel00 <mryel00.github@gmail.com>

---------

Signed-off-by: mryel00 <mryel00.github@gmail.com>
2024-05-10 21:28:15 +02:00
2 changed files with 29 additions and 30 deletions

2
.gitignore vendored
View File

@@ -1,7 +1,7 @@
.idea
.vscode
.idea
.pytest_cache
__pycache__
.kiauh-env
*.code-workspace
*.iml

View File

@@ -28,7 +28,6 @@ from utils.git_utils import (
get_remote_commit,
git_pull_wrapper,
)
from utils.input_utils import get_confirm
from utils.logger import Logger
from utils.sys_utils import (
parse_packages_from_file,
@@ -48,23 +47,37 @@ def install_crowsnest() -> None:
instances: List[Klipper] = im.find_instances()
if len(instances) > 1:
Logger.print_status("Multi instance install detected ...")
info = textwrap.dedent("""
Crowsnest is NOT designed to support multi instances.
A workaround for this is to choose the most used instance as a 'master'
Use this instance to set up your 'crowsnest.conf' and steering it's service.
Found the following instances:
""")[:-1]
print(info, end="")
for instance in instances:
print(f"{instance.data_dir_name}")
configure_multi_instance(instances)
Logger.print_status("\nLaunching crowsnest's configuration tool ...")
if not get_confirm("Continue with configuration?", False, allow_go_back=True):
Logger.print_info("Installation aborted by user ... Exiting!")
# Step 4: Launch crowsnest installer
print(f"{COLOR_CYAN}Installer will prompt you for sudo password!{RESET_FORMAT}")
Logger.print_status("Launching crowsnest installer ...")
try:
run(
f"sudo make install BASE_USER={CURRENT_USER}",
cwd=CROWSNEST_DIR,
shell=True,
check=True,
)
except CalledProcessError as e:
Logger.print_error(f"Something went wrong! Please try again...\n{e}")
return
def configure_multi_instance(instances: List[Klipper]) -> None:
Logger.print_status("Multi instance install detected ...")
info = textwrap.dedent("""
Crowsnest is NOT designed to support multi instances.
A workaround for this is to choose the most used instance as a 'master'
Use this instance to set up your 'crowsnest.conf' and steering it's service.
Found the following instances:
""")[:-1]
print(info, end="")
for instance in instances:
print(f"{instance.data_dir_name}")
Logger.print_status("\nLaunching crowsnest's configuration tool ...")
config = Path(CROWSNEST_DIR).joinpath("tools/.config")
try:
run(
@@ -83,20 +96,6 @@ def install_crowsnest() -> None:
Logger.print_error("Generating .config failed, installation aborted")
return
# Step 4: Launch crowsnest installer
print(f"{COLOR_CYAN}Installer will prompt you for sudo password!{RESET_FORMAT}")
Logger.print_status("Launching crowsnest installer ...")
try:
run(
f"sudo make install BASE_USER={CURRENT_USER}",
cwd=CROWSNEST_DIR,
shell=True,
check=True,
)
except CalledProcessError as e:
Logger.print_error(f"Something went wrong! Please try again...\n{e}")
return
def update_crowsnest() -> None:
try: