pub fn try_default() -> Result<Self> {
        // Invoke rpm-ostree to get the status of the currently booted deployment.
        let status = rpm_ostree::invoke_cli_status(true)?;
        let basearch = rpm_ostree::parse_basearch(&status)
            .context("failed to introspect OS base architecture")?;
        let current_os =
            rpm_ostree::parse_booted(&status).context("failed to introspect booted OS image")?;
        let node_uuid = {
            let app_id = id128::Id128::try_from_slice(APP_ID)
                .map_err(|e| anyhow!("failed to parse application ID: {}", e))?;
            compute_node_uuid(&app_id)?
        };
        let platform = platform::read_id("/proc/cmdline")?;
        let stream = rpm_ostree::parse_booted_updates_stream(&status)
            .context("failed to introspect OS updates stream")?;

        let id = Self {
            basearch,
            stream,
            platform,
            current_os,
            group: DEFAULT_GROUP.to_string(),
            node_uuid,
            rollout_wariness: None,
        };
        Ok(id)
    }
/// Try to build default agent identity.
Try to build default agent identity.
Try to build default agent identity .
pub fn try_default() -> Result<Self> {
        // Invoke rpm-ostree to get the status of the currently booted deployment.
        let status = rpm_ostree::invoke_cli_status(true)?;
        let basearch = rpm_ostree::parse_basearch(&status)
            .context("failed to introspect OS base architecture")?;
        let current_os =
            rpm_ostree::parse_booted(&status).context("failed to introspect booted OS image")?;
        let node_uuid = {
            let app_id = id128::Id128::try_from_slice(APP_ID)
                .map_err(|e| anyhow!("failed to parse application ID: {}", e))?;
            compute_node_uuid(&app_id)?
        };
        let platform = platform::read_id("/proc/cmdline")?;
        let stream = rpm_ostree::parse_booted_updates_stream(&status)
            .context("failed to introspect OS updates stream")?;
        let id = Self {
            basearch,
            stream,
            platform,
            current_os,
            group: DEFAULT_GROUP.to_string(),
            node_uuid,
            rollout_wariness: None,
        };
        Ok(id)
    }
pub fn try_default ( ) -> Result < Self > { // Invoke rpm-ostree to get the status of the currently booted deployment. let status = rpm_ostree :: invoke_cli_status ( true ) ? ; let basearch = rpm_ostree :: parse_basearch ( & status ) . context ( " " ) ? ; let current_os = rpm_ostree :: parse_booted ( & status ) . context ( " " ) ? ; let node_uuid = { let app_id = id128 :: Id128 :: try_from_slice ( APP_ID ) . map_err ( | e | anyhow ! ( " " e ) ) ? ; compute_node_uuid ( & app_id ) ? } ; let platform = platform :: read_id ( " " ) ? ; let stream = rpm_ostree :: parse_booted_updates_stream ( & status ) . context ( " " ) ? ; let id = Self { basearch , stream , platform , current_os , group : DEFAULT_GROUP . to_string ( ) , node_uuid , rollout_wariness : None , } ; Ok ( id ) }
Try to build default agent identity.
Try to build default agent identity .