mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-10 06:01:39 +08:00
select the conf dist file depending on platform
This commit is contained in:
parent
16c50c6019
commit
4ce9e9b171
1 changed files with 5 additions and 4 deletions
|
|
@ -8,7 +8,7 @@ __author__ = "Orsiris de Jong"
|
||||||
__copyright__ = "Copyright (C) 2023 NetInvent"
|
__copyright__ = "Copyright (C) 2023 NetInvent"
|
||||||
__license__ = "GPL-3.0-only"
|
__license__ = "GPL-3.0-only"
|
||||||
__build__ = "2023033001"
|
__build__ = "2023033001"
|
||||||
__version__ = "1.8.2"
|
__version__ = "1.8.3"
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
@ -26,7 +26,7 @@ import os
|
||||||
import argparse
|
import argparse
|
||||||
import atexit
|
import atexit
|
||||||
from command_runner import command_runner
|
from command_runner import command_runner
|
||||||
from ofunctions.platform import python_arch
|
from ofunctions.platform import python_arch, get_os
|
||||||
|
|
||||||
AUDIENCES = ["public", "private"]
|
AUDIENCES = ["public", "private"]
|
||||||
|
|
||||||
|
|
@ -145,10 +145,11 @@ def move_audience_files(audience):
|
||||||
|
|
||||||
|
|
||||||
def get_conf_dist_file(audience):
|
def get_conf_dist_file(audience):
|
||||||
|
platform = get_os().lower()
|
||||||
if audience == "private":
|
if audience == "private":
|
||||||
dist_conf_file_path = os.path.join(BASEDIR, os.pardir, "PRIVATE", "_private_npbackup.conf.dist")
|
dist_conf_file_path = os.path.join(BASEDIR, os.pardir, "PRIVATE", "_private_npbackup.{}.conf.dist".format(platform))
|
||||||
else:
|
else:
|
||||||
dist_conf_file_path = os.path.join(BASEDIR, os.pardir, "examples", "npbackup.conf.dist")
|
dist_conf_file_path = os.path.join(BASEDIR, os.pardir, "examples", "npbackup.{}.conf.dist".format(platform))
|
||||||
if not os.path.isfile(dist_conf_file_path):
|
if not os.path.isfile(dist_conf_file_path):
|
||||||
print("DIST CONF FILE NOT FOUND: {}".format(dist_conf_file_path))
|
print("DIST CONF FILE NOT FOUND: {}".format(dist_conf_file_path))
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue