Sha256: 602356c134f45976b831c8de8a7712df6626e2eb4fed72f5b1142f3a6c3c6cab

Contents?: true

Size: 955 Bytes

Versions: 6

Compression:

Stored size: 955 Bytes

Contents

#include <internal/facts/freebsd/disk_resolver.hpp>
#include <internal/util/freebsd/geom.hpp>
#include <leatherman/logging/logging.hpp>

#include <libgeom.h>

using namespace std;

namespace facter { namespace facts { namespace freebsd {

    disk_resolver::data disk_resolver::collect_data(collection& facts)
    {
        data result;

        try {
            facter::util::freebsd::geom_class disks("DISK");

            for (auto& geom : disks.geoms) {
                for (auto& provider : geom.providers) {
                    disk d;
                    d.name = provider.name();
                    d.size = provider.mediasize();
                    d.model = provider.config("descr");
                    result.disks.push_back(move(d));
                }
            }
        } catch (util::freebsd::geom_exception const &e) {
            LOG_ERROR(e.what());
        }

        return result;
    }

}}}  // namespace facter::facts::freebsd

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/facter/lib/src/facts/freebsd/disk_resolver.cc
facter-3.12.1.cfacter.20181031 ext/facter/facter/lib/src/facts/freebsd/disk_resolver.cc
facter-3.12.1.cfacter.20181023 ext/facter/facter/lib/src/facts/freebsd/disk_resolver.cc
facter-3.12.0.cfacter.20181004 ext/facter/facter/lib/src/facts/freebsd/disk_resolver.cc
facter-3.12.0.cfacter.20181001 ext/facter/facter/lib/src/facts/freebsd/disk_resolver.cc
facter-3.12.0.cfacter.20180918 ext/facter/facter/lib/src/facts/freebsd/disk_resolver.cc