Page MenuHomeDevCentral

rust.py
No OneTemporary

# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# Salt — Rust module
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Description: Provide support for Rust properties
# License: BSD-2-Clause
# -------------------------------------------------------------
from salt.utils.path import which as path_which
def __virtual__():
"""
Only load if the Rust compiler is available
"""
return path_which('rustc') is not None,\
"The Rust execution module cannot be loaded: rustc not installed."
def get_rustc_triplet():
"""
A function to get a node triplet for Rust toolchains.
CLI Example:
salt * rust.get_rustc_triplet
"""
# Thanks to @semarie for that tip.
return __salt__['cmd.shell']("rustc -vV | sed -ne 's/^host: //p'")

File Metadata

Mime Type
text/x-python
Expires
Mon, Nov 25, 10:38 (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260018
Default Alt Text
rust.py (891 B)

Event Timeline