Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(FACT-1416) Use the -c flag when calling zoneadm for Solaris zone facts #1329

Merged
merged 1 commit into from
May 16, 2016

Conversation

whopper
Copy link

@whopper whopper commented May 12, 2016

Previously, Facter called zoneadm using only the -p flag when
querying the system for zones, which excluded non-running zones.
This is a breaking change from Facter 2, where Facter reported
all zones.

This commit updates the zone resolver to use the -c flag when
calling zoneadm, as we did in Facter 2. In addition, the zone
regex has been modified to match a '-' at the beginning of a
zone entry, as is the output for non-running zones.

@kylog
Copy link

kylog commented May 12, 2016

LGTM.

@puppetcla
Copy link

CLA signed by all contributors.

@whopper
Copy link
Author

whopper commented May 12, 2016

root@ns9ptobpve8wrtu:~# zoneadm list -cp
0:global:running:/::solaris:shared:-:none
-:testzone:configured:/zones/testzone::solaris:excl:-:
-:testzone2:configured:/zones/testzone2::solaris:excl:-:

Output with Facter 2:

timezone => PDT
zone_global_brand => solaris
zone_global_id => 0
zone_global_iptype => shared
zone_global_name => global
zone_global_path => /
zone_global_status => running
zone_global_uuid =>
zone_testzone2_brand => solaris
zone_testzone2_id => -
zone_testzone2_iptype => excl
zone_testzone2_name => testzone2
zone_testzone2_path => /zones/testzone2
zone_testzone2_status => configured
zone_testzone2_uuid =>
zone_testzone_brand => solaris
zone_testzone_id => -
zone_testzone_iptype => excl
zone_testzone_name => testzone
zone_testzone_path => /zones/testzone
zone_testzone_status => configured
zone_testzone_uuid =>

With this change in Facter 3:

root@jnhqf8ibhpj9098:~# facter solaris_zones
{
  current => "global",
  zones => {
    global => {
      brand => "solaris",
      id => "0",
      ip_type => "shared",
      path => "/",
      status => "running"
    },
    testzone => {
      brand => "solaris",
      id => "-",
      ip_type => "excl",
      path => "/zones/testzone",
      status => "configured"
    },
    testzone2 => {
      brand => "solaris",
      id => "-",
      ip_type => "excl",
      path => "/zones/testzone2",
      status => "configured"
    }
  }
}

@whopper whopper changed the title (WIP)(FACT-1416) Use the -c flag when calling zoneadm for Solaris zone facts (FACT-1416) Use the -c flag when calling zoneadm for Solaris zone facts May 12, 2016
Previously, Facter called zoneadm using only the -p flag when
querying the system for zones, which excluded non-running zones.
This is a breaking change from Facter 2, where Facter reported
all zones.

This commit updates the zone resolver to use the -c flag when
calling zoneadm, as we did in Facter 2. In addition, the zone
regex has been modified to match a '-' at the beginning of a
zone entry, as is the output for non-running zones.
@whopper whopper force-pushed the FACT-1416/stable/solaris_zones branch from 0a7cdef to f89c3ff Compare May 12, 2016 17:57
@HAIL9000 HAIL9000 merged commit a2bf3d1 into puppetlabs:stable May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants