Current Dir: /snap/core22/2955/usr/share/subiquity/console_conf/controllers/__pycache__/
[FILE] chooser.cpython-310.pyc [ edit | delete | rename ]
[FILE] identity.cpython-310.pyc [ edit | delete | rename ]
[FILE] welcome.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]
Viewing: /snap/core22/2955/usr/share/subiquity/console_conf/controllers/__pycache__/identity.cpython-310.pyc
o
K��^ � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ d dl m
Z
d dlmZ d dl
mZ d dlmZmZ e�d�Zdd � Zd
d� Zdd
� Zdd� ZdZdZdd� Zdd� ZG dd� de�ZdS )� N)�
host_key_info�get_ips_standalone)�SnapdConnection)�
TuiController)�run_command)�IdentityView� LoginViewz!console_conf.controllers.identityc C s� d} zt | d��}|�� }W d � n1 sw Y W n
ty' Y dS w d}t�|�D ]}|�d�\}}}|dkrD|dkrD dS |dkrM|} |S q/|S )z6 For a ubuntu-core system, return its version or None z/usr/lib/os-release�rN�=�IDzubuntu-core�
VERSION_ID)�open�read�FileNotFoundError�shlex�split� partition)�path�fp�content�version�line�key�_�value� r �9/usr/share/subiquity/console_conf/controllers/identity.py�get_core_version s(
����r c C s t dd�} | �d��� d d S )z Check if device is managed � �/run/snapd.socketzv2/system-info�result�managed)r �get�json)�conr r r �get_managed6 s
r% c C s6 zt �| �}W n
ty Y dS w |j�dd�d S )Nr �,� r )�pwd�getpwnam�KeyError�pw_gecosr )�username�infor r r �get_realname<