Sha256: c302535983bffd3f45829610837615dcd9c2afaf892782a856ef2da740bc29e3
Contents?: true
Size: 1.09 KB
Versions: 16
Compression:
Stored size: 1.09 KB
Contents
#include <internal/facts/solaris/zone_resolver.hpp> #include <facter/facts/collection.hpp> #include <leatherman/execution/execution.hpp> #include <leatherman/util/regex.hpp> #include <boost/algorithm/string.hpp> using namespace std; using namespace facter::facts; using namespace leatherman::util; using namespace leatherman::execution; namespace facter { namespace facts { namespace solaris { zone_resolver::data zone_resolver::collect_data(collection& facts) { data result; auto exec = execute("/bin/zonename"); if (exec.success) { result.current_zone_name = exec.output; } static boost::regex zone_pattern("(\\d+|-):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)"); each_line("/usr/sbin/zoneadm", {"list", "-cp"}, [&](string& line) { zone z; if (re_search(line, zone_pattern, &z.id, &z.name, &z.status, &z.path, &z.uuid, &z.brand, &z.ip_type)) { result.zones.emplace_back(move(z)); } return true; }); return result; } }}} // namespace facter::facts::solaris
Version data entries
16 entries across 16 versions & 2 rubygems