console_conf: use snap helper for obtaining project name

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
This commit is contained in:
Maciej Borzecki 2024-02-06 14:56:27 +01:00
parent 0764bb50b9
commit 87efd8aa18
1 changed files with 2 additions and 2 deletions

View File

@ -14,11 +14,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging import logging
import os
from console_conf.models.console_conf import ConsoleConfModel from console_conf.models.console_conf import ConsoleConfModel
from console_conf.models.systems import RecoverySystemsModel from console_conf.models.systems import RecoverySystemsModel
from subiquitycore.prober import Prober from subiquitycore.prober import Prober
from subiquitycore.snap import snap_name
from subiquitycore.tui import TuiApplication from subiquitycore.tui import TuiApplication
log = logging.getLogger("console_conf.core") log = logging.getLogger("console_conf.core")
@ -27,7 +27,7 @@ log = logging.getLogger("console_conf.core")
# ends up as /run/console-conf. Note this should only be changed in # ends up as /run/console-conf. Note this should only be changed in
# coordination with console-conf-wrapper and any other glue shipped with Ubuntu # coordination with console-conf-wrapper and any other glue shipped with Ubuntu
# Core boot base # Core boot base
CONSOLE_CONF_PROJECT = os.getenv("SNAP_INSTANCE_NAME", "console-conf") CONSOLE_CONF_PROJECT = snap_name() or "console-conf"
class ConsoleConf(TuiApplication): class ConsoleConf(TuiApplication):