diff -Nru facter-2.3.0/acceptance/bin/ci-bootstrap-from-artifacts.sh facter-2.4.6/acceptance/bin/ci-bootstrap-from-artifacts.sh --- facter-2.3.0/acceptance/bin/ci-bootstrap-from-artifacts.sh 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/bin/ci-bootstrap-from-artifacts.sh 2016-01-26 18:41:33.000000000 +0000 @@ -46,7 +46,7 @@ { :hosts_file => 'config/nodes/${platform}.yaml', :ssh => { - :keys => ["${HOME}/.ssh/id_rsa-old.private"], + :keys => ["${HOME}/.ssh/id_rsa-acceptance"], }, ${repo_proxy} } diff -Nru facter-2.3.0/acceptance/config/aio/options.rb facter-2.4.6/acceptance/config/aio/options.rb --- facter-2.3.0/acceptance/config/aio/options.rb 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/aio/options.rb 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,6 @@ +{ + :type => 'aio', + :pre_suite => [ + 'setup/aio/pre-suite/010_Install.rb', + ], +} diff -Nru facter-2.3.0/acceptance/config/nodes/centos-5-i386.yaml facter-2.4.6/acceptance/config/nodes/centos-5-i386.yaml --- facter-2.3.0/acceptance/config/nodes/centos-5-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/centos-5-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: centos-5-i386 + hypervisor: vcloud + template: centos-5-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/centos-5-x86_64.yaml facter-2.4.6/acceptance/config/nodes/centos-5-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/centos-5-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/centos-5-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: centos-5-x86_64 + hypervisor: vcloud + template: centos-5-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/centos5.yaml facter-2.4.6/acceptance/config/nodes/centos5.yaml --- facter-2.3.0/acceptance/config/nodes/centos5.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/centos5.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HOSTS: - agent-centos-5-x86_64: - roles: - - agent - platform: el-5-x86_64 - template: centos-5-x86_64 - hypervisor: vcloud - agent-centos-5-i386: - roles: - - agent - platform: el-5-i386 - template: centos-5-i386 - hypervisor: vcloud -CONFIG: - datastore: instance0 - folder: Delivery/Quality Assurance/FOSS/Dynamic - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/centos-6-i386.yaml facter-2.4.6/acceptance/config/nodes/centos-6-i386.yaml --- facter-2.3.0/acceptance/config/nodes/centos-6-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/centos-6-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: centos-6-i386 + hypervisor: vcloud + template: centos-6-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/centos-6-x86_64.yaml facter-2.4.6/acceptance/config/nodes/centos-6-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/centos-6-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/centos-6-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: centos-6-x86_64 + hypervisor: vcloud + template: centos-6-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/debian-6-i386.yaml facter-2.4.6/acceptance/config/nodes/debian-6-i386.yaml --- facter-2.3.0/acceptance/config/nodes/debian-6-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/debian-6-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: debian-squeeze-i386 + hypervisor: vcloud + template: debian-6-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/debian-6-x86_64.yaml facter-2.4.6/acceptance/config/nodes/debian-6-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/debian-6-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/debian-6-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: debian-squeeze-x86_64 + hypervisor: vcloud + template: debian-6-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/debian-7-i386.yaml facter-2.4.6/acceptance/config/nodes/debian-7-i386.yaml --- facter-2.3.0/acceptance/config/nodes/debian-7-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/debian-7-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: debian-wheezy-i386 + hypervisor: vcloud + template: debian-7-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/debian-7-x86_64.yaml facter-2.4.6/acceptance/config/nodes/debian-7-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/debian-7-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/debian-7-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: debian-wheezy-x86_64 + hypervisor: vcloud + template: debian-7-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/debian-8-i386.yaml facter-2.4.6/acceptance/config/nodes/debian-8-i386.yaml --- facter-2.3.0/acceptance/config/nodes/debian-8-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/debian-8-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: debian-jessie-i386 + hypervisor: vcloud + template: debian-8-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/debian-8-x86_64.yaml facter-2.4.6/acceptance/config/nodes/debian-8-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/debian-8-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/debian-8-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: debian-jessie-x86_64 + hypervisor: vcloud + template: debian-8-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/fedora19.yaml facter-2.4.6/acceptance/config/nodes/fedora19.yaml --- facter-2.3.0/acceptance/config/nodes/fedora19.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/fedora19.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HOSTS: - agent-fedora-19-x86_64: - roles: - - agent - platform: fedora-19-x86_64 - template: fedora-19-x86_64 - hypervisor: vcloud - agent-fedora-19-i386: - roles: - - agent - platform: fedora-19-i386 - template: fedora-19-i386 - hypervisor: vcloud -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/fedora-20-i386.yaml facter-2.4.6/acceptance/config/nodes/fedora-20-i386.yaml --- facter-2.3.0/acceptance/config/nodes/fedora-20-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/fedora-20-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: fedora-20-i386 + hypervisor: vcloud + template: fedora-20-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/fedora-20-x86_64.yaml facter-2.4.6/acceptance/config/nodes/fedora-20-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/fedora-20-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/fedora-20-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: fedora-20-x86_64 + hypervisor: vcloud + template: fedora-20-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/fedora20.yaml facter-2.4.6/acceptance/config/nodes/fedora20.yaml --- facter-2.3.0/acceptance/config/nodes/fedora20.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/fedora20.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HOSTS: - agent-fedora-20-x86_64: - roles: - - agent - platform: fedora-20-x86_64 - template: fedora-20-x86_64 - hypervisor: vcloud - agent-fedora-20-i386: - roles: - - agent - platform: fedora-20-i386 - template: fedora-20-i386 - hypervisor: vcloud -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/fedora-21-i386.yaml facter-2.4.6/acceptance/config/nodes/fedora-21-i386.yaml --- facter-2.3.0/acceptance/config/nodes/fedora-21-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/fedora-21-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: fedora-21-i386 + hypervisor: vcloud + template: fedora-21-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/fedora-21-x86_64.yaml facter-2.4.6/acceptance/config/nodes/fedora-21-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/fedora-21-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/fedora-21-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: fedora-21-x86_64 + hypervisor: vcloud + template: fedora-21-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/lucid.yaml facter-2.4.6/acceptance/config/nodes/lucid.yaml --- facter-2.3.0/acceptance/config/nodes/lucid.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/lucid.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HOSTS: - agent-lucid-x86_64: - roles: - - agent - platform: ubuntu-lucid-x86_64 - template: ubuntu-1004-x86_64 - hypervisor: vcloud - agent-lucid-i386: - roles: - - agent - platform: ubuntu-lucid-i386 - template: ubuntu-1004-i386 - hypervisor: vcloud -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/precise.yaml facter-2.4.6/acceptance/config/nodes/precise.yaml --- facter-2.3.0/acceptance/config/nodes/precise.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/precise.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HOSTS: - agent-precise-x86_64: - roles: - - agent - platform: ubuntu-precise-x86_64 - template: ubuntu-1204-x86_64 - hypervisor: vcloud - agent-precise-i386: - roles: - - agent - platform: ubuntu-precise-i386 - template: ubuntu-1204-i386 - hypervisor: vcloud -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/redhat-5-i386.yaml facter-2.4.6/acceptance/config/nodes/redhat-5-i386.yaml --- facter-2.3.0/acceptance/config/nodes/redhat-5-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/redhat-5-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: el-5-i386 + hypervisor: vcloud + template: redhat-5-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/redhat-5-x86_64.yaml facter-2.4.6/acceptance/config/nodes/redhat-5-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/redhat-5-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/redhat-5-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: el-5-x86_64 + hypervisor: vcloud + template: redhat-5-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/redhat-6-i386.yaml facter-2.4.6/acceptance/config/nodes/redhat-6-i386.yaml --- facter-2.3.0/acceptance/config/nodes/redhat-6-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/redhat-6-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: el-6-i386 + hypervisor: vcloud + template: redhat-6-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/redhat-6-x86_64.yaml facter-2.4.6/acceptance/config/nodes/redhat-6-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/redhat-6-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/redhat-6-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: el-6-x86_64 + hypervisor: vcloud + template: redhat-6-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/redhat-7-x86_64.yaml facter-2.4.6/acceptance/config/nodes/redhat-7-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/redhat-7-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/redhat-7-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: el-7-x86_64 + hypervisor: vcloud + template: redhat-7-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/rhel6.yaml facter-2.4.6/acceptance/config/nodes/rhel6.yaml --- facter-2.3.0/acceptance/config/nodes/rhel6.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/rhel6.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HOSTS: - agent-rhel6-x86_64: - roles: - - agent - platform: el-6-x86_64 - template: redhat-6-x86_64 - hypervisor: vcloud - agent-rhel6-i386: - roles: - - agent - platform: el-6-i386 - template: redhat-6-i386 - hypervisor: vcloud -CONFIG: - datastore: instance0 - folder: Delivery/Quality Assurance/FOSS/Dynamic - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/rhel7.yaml facter-2.4.6/acceptance/config/nodes/rhel7.yaml --- facter-2.3.0/acceptance/config/nodes/rhel7.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/rhel7.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -HOSTS: - agent-rhel7-x86_64: - roles: - - agent - platform: el-7-x86_64 - template: redhat-7-x86_64 - hypervisor: vcloud -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/solaris10.yaml facter-2.4.6/acceptance/config/nodes/solaris10.yaml --- facter-2.3.0/acceptance/config/nodes/solaris10.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/solaris10.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -HOSTS: - agent-solaris10-x86_64: - roles: - - agent - platform: solaris-10-x86_64 - template: solaris-10-x86_64 - hypervisor: vcloud -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/solaris11.yaml facter-2.4.6/acceptance/config/nodes/solaris11.yaml --- facter-2.3.0/acceptance/config/nodes/solaris11.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/solaris11.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -HOSTS: - agent-solaris-11-x86_64: - roles: - - agent - platform: solaris-11-x86_64 - template: solaris-11-x86_64 - hypervisor: vcloud -CONFIG: - datastore: instance0 - folder: Delivery/Quality Assurance/FOSS/Dynamic - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/squeeze.yaml facter-2.4.6/acceptance/config/nodes/squeeze.yaml --- facter-2.3.0/acceptance/config/nodes/squeeze.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/squeeze.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HOSTS: - agent-squeeze-x86_64: - roles: - - agent - platform: debian-squeeze-x86_64 - template: debian-6-x86_64 - hypervisor: vcloud - agent-squeeze-i386: - roles: - - agent - platform: debian-squeeze-i386 - template: debian-6-i386 - hypervisor: vcloud -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/trusty.yaml facter-2.4.6/acceptance/config/nodes/trusty.yaml --- facter-2.3.0/acceptance/config/nodes/trusty.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/trusty.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HOSTS: - agent-trusty-x86_64: - roles: - - agent - platform: ubuntu-trusty-x86_64 - template: ubuntu-1404-x86_64 - hypervisor: vcloud - agent-trusty-i386: - roles: - - agent - platform: ubuntu-trusty-i386 - template: ubuntu-1404-i386 - hypervisor: vcloud -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/ubuntu-1204-i386.yaml facter-2.4.6/acceptance/config/nodes/ubuntu-1204-i386.yaml --- facter-2.3.0/acceptance/config/nodes/ubuntu-1204-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/ubuntu-1204-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: ubuntu-precise-i386 + hypervisor: vcloud + template: ubuntu-1204-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/ubuntu-1204-x86_64.yaml facter-2.4.6/acceptance/config/nodes/ubuntu-1204-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/ubuntu-1204-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/ubuntu-1204-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: ubuntu-precise-x86_64 + hypervisor: vcloud + template: ubuntu-1204-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/ubuntu-1404-i386.yaml facter-2.4.6/acceptance/config/nodes/ubuntu-1404-i386.yaml --- facter-2.3.0/acceptance/config/nodes/ubuntu-1404-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/ubuntu-1404-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: ubuntu-trusty-i386 + hypervisor: vcloud + template: ubuntu-1404-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/ubuntu-1404-x86_64.yaml facter-2.4.6/acceptance/config/nodes/ubuntu-1404-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/ubuntu-1404-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/ubuntu-1404-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: ubuntu-trusty-x86_64 + hypervisor: vcloud + template: ubuntu-1404-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/ubuntu-1410-i386.yaml facter-2.4.6/acceptance/config/nodes/ubuntu-1410-i386.yaml --- facter-2.3.0/acceptance/config/nodes/ubuntu-1410-i386.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/ubuntu-1410-i386.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: ubuntu-utopic-i386 + hypervisor: vcloud + template: ubuntu-1410-i386 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/ubuntu-1410-x86_64.yaml facter-2.4.6/acceptance/config/nodes/ubuntu-1410-x86_64.yaml --- facter-2.3.0/acceptance/config/nodes/ubuntu-1410-x86_64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/ubuntu-1410-x86_64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,13 @@ +--- +HOSTS: + agent: + roles: + - agent + platform: ubuntu-utopic-x86_64 + hypervisor: vcloud + template: ubuntu-1410-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/wheezy.yaml facter-2.4.6/acceptance/config/nodes/wheezy.yaml --- facter-2.3.0/acceptance/config/nodes/wheezy.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/wheezy.yaml 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -HOSTS: - agent-wheezy-x86_64: - roles: - - agent - platform: debian-wheezy-x86_64 - template: debian-7-x86_64 - hypervisor: vcloud - agent-wheezy-i386: - roles: - - agent - platform: debian-wheezy-i386 - template: debian-7-i386 - hypervisor: vcloud -CONFIG: - datastore: instance0 - resourcepool: delivery/Quality Assurance/FOSS/Dynamic - folder: Delivery/Quality Assurance/FOSS/Dynamic - pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/win2003r2x64-rubyx64.yaml facter-2.4.6/acceptance/config/nodes/win2003r2x64-rubyx64.yaml --- facter-2.3.0/acceptance/config/nodes/win2003r2x64-rubyx64.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2003r2x64-rubyx64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: agent-2003r2-x86_64-rubyx64: roles: - - agent + - agent platform: windows-2003r2-64 ruby_arch: x64 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003r2-x86_64 + template: win-2003r2-x86_64 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2003r2x64-rubyx86.yaml facter-2.4.6/acceptance/config/nodes/win2003r2x64-rubyx86.yaml --- facter-2.3.0/acceptance/config/nodes/win2003r2x64-rubyx86.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2003r2x64-rubyx86.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: - agent-2003r2-x86_64: + agent-2003r2-x86_64-rubyx86: roles: - - agent + - agent platform: windows-2003r2-64 ruby_arch: x86 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003r2-x86_64 + template: win-2003r2-x86_64 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2003r2x86-rubyx86.yaml facter-2.4.6/acceptance/config/nodes/win2003r2x86-rubyx86.yaml --- facter-2.3.0/acceptance/config/nodes/win2003r2x86-rubyx86.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2003r2x86-rubyx86.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: agent-2003r2-i386: roles: - - agent + - agent platform: windows-2003r2-32 ruby_arch: x86 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003r2-i386 + template: win-2003r2-i386 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2003x64-rubyx64.yaml facter-2.4.6/acceptance/config/nodes/win2003x64-rubyx64.yaml --- facter-2.3.0/acceptance/config/nodes/win2003x64-rubyx64.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2003x64-rubyx64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: agent-2003-x86_64-rubyx64: roles: - - agent + - agent platform: windows-2003-64 ruby_arch: x64 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003-x86_64 + template: win-2003-x86_64 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2003x64-rubyx86.yaml facter-2.4.6/acceptance/config/nodes/win2003x64-rubyx86.yaml --- facter-2.3.0/acceptance/config/nodes/win2003x64-rubyx86.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2003x64-rubyx86.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: - agent-2003-x86_64: + agent-2003-x86_64-rubyx86: roles: - - agent + - agent platform: windows-2003-64 ruby_arch: x86 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003-x86_64 + template: win-2003-x86_64 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2003x86-rubyx86.yaml facter-2.4.6/acceptance/config/nodes/win2003x86-rubyx86.yaml --- facter-2.3.0/acceptance/config/nodes/win2003x86-rubyx86.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2003x86-rubyx86.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: agent-2003-i386: roles: - - agent + - agent platform: windows-2003-32 ruby_arch: x86 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2003-i386 + template: win-2003-i386 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2008r2-rubyx64.yaml facter-2.4.6/acceptance/config/nodes/win2008r2-rubyx64.yaml --- facter-2.3.0/acceptance/config/nodes/win2008r2-rubyx64.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2008r2-rubyx64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: agent-2008r2-x86_64-rubyx64: roles: - - agent + - agent platform: windows-2008r2-64 ruby_arch: x64 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2008r2-x86_64 + template: win-2008r2-x86_64 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2008r2-rubyx86.yaml facter-2.4.6/acceptance/config/nodes/win2008r2-rubyx86.yaml --- facter-2.3.0/acceptance/config/nodes/win2008r2-rubyx86.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2008r2-rubyx86.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: - agent-2008r2-x86_64: + agent-2008r2-x86_64-rubyx86: roles: - - agent + - agent platform: windows-2008r2-64 ruby_arch: x86 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2008r2-x86_64 + template: win-2008r2-x86_64 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2008-rubyx64.yaml facter-2.4.6/acceptance/config/nodes/win2008-rubyx64.yaml --- facter-2.3.0/acceptance/config/nodes/win2008-rubyx64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2008-rubyx64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,14 @@ +--- +HOSTS: + agent-2008-x86_64-rubyx64: + roles: + - agent + platform: windows-2008-64 + ruby_arch: x64 + hypervisor: vcloud + template: win-2008-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/win2008-rubyx86.yaml facter-2.4.6/acceptance/config/nodes/win2008-rubyx86.yaml --- facter-2.3.0/acceptance/config/nodes/win2008-rubyx86.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2008-rubyx86.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,14 @@ +--- +HOSTS: + agent-2008-x86_64-rubyx86: + roles: + - agent + platform: windows-2008-64 + ruby_arch: x86 + hypervisor: vcloud + template: win-2008-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/win2012r2-rubyx64.yaml facter-2.4.6/acceptance/config/nodes/win2012r2-rubyx64.yaml --- facter-2.3.0/acceptance/config/nodes/win2012r2-rubyx64.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2012r2-rubyx64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: agent-2012r2-x86_64-rubyx64: roles: - - agent + - agent platform: windows-2012r2-64 ruby_arch: x64 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2012r2-x86_64 + template: win-2012r2-x86_64 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2012r2-rubyx86.yaml facter-2.4.6/acceptance/config/nodes/win2012r2-rubyx86.yaml --- facter-2.3.0/acceptance/config/nodes/win2012r2-rubyx86.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2012r2-rubyx86.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -1,11 +1,12 @@ +--- HOSTS: - agent-2012r2-x86_64: + agent-2012r2-x86_64-rubyx86: roles: - - agent + - agent platform: windows-2012r2-64 ruby_arch: x86 hypervisor: vcloud - template: Delivery/Quality Assurance/Templates/vCloud/win-2012r2-x86_64 + template: win-2012r2-x86_64 CONFIG: datastore: instance0 resourcepool: delivery/Quality Assurance/FOSS/Dynamic diff -Nru facter-2.3.0/acceptance/config/nodes/win2012-rubyx64.yaml facter-2.4.6/acceptance/config/nodes/win2012-rubyx64.yaml --- facter-2.3.0/acceptance/config/nodes/win2012-rubyx64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2012-rubyx64.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,14 @@ +--- +HOSTS: + agent-2012-x86_64-rubyx64: + roles: + - agent + platform: windows-2012-64 + ruby_arch: x64 + hypervisor: vcloud + template: win-2012-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/config/nodes/win2012-rubyx86.yaml facter-2.4.6/acceptance/config/nodes/win2012-rubyx86.yaml --- facter-2.3.0/acceptance/config/nodes/win2012-rubyx86.yaml 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/config/nodes/win2012-rubyx86.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,14 @@ +--- +HOSTS: + agent-2012-x86_64-rubyx86: + roles: + - agent + platform: windows-2012-64 + ruby_arch: x86 + hypervisor: vcloud + template: win-2012-x86_64 +CONFIG: + datastore: instance0 + resourcepool: delivery/Quality Assurance/FOSS/Dynamic + folder: Delivery/Quality Assurance/FOSS/Dynamic + pooling_api: http://vmpooler.delivery.puppetlabs.net/ diff -Nru facter-2.3.0/acceptance/Gemfile facter-2.4.6/acceptance/Gemfile --- facter-2.3.0/acceptance/Gemfile 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/Gemfile 2016-01-26 18:41:33.000000000 +0000 @@ -1,12 +1,22 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" -gem "beaker", "~> 1.17.2" +def location_for(place, fake_version = nil) + if place =~ /^(git:[^#]*)#(.*)/ + [fake_version, { :git => $1, :branch => $2, :require => false }].compact + elsif place =~ /^file:\/\/(.*)/ + ['>= 0', { :path => File.expand_path($1), :require => false }] + else + [place, { :require => false }] + end +end + +gem "beaker", *location_for(ENV['BEAKER_VERSION'] || 'git://github.com/puppetlabs/beaker#master') gem 'rake', "~> 10.1.0" # json-schema does not support windows, so use the 'ruby' platform to exclude it on windows platforms :ruby do # json-schema uses multi_json, but chokes with multi_json 1.7.9, so prefer 1.7.7 - gem "multi_json", "1.7.7", :require => false + gem "multi_json", "~> 1.10", :require => false gem "json-schema", "2.1.1", :require => false end diff -Nru facter-2.3.0/acceptance/lib/puppet/acceptance/common_utils.rb facter-2.4.6/acceptance/lib/puppet/acceptance/common_utils.rb --- facter-2.3.0/acceptance/lib/puppet/acceptance/common_utils.rb 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/lib/puppet/acceptance/common_utils.rb 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,19 @@ +module Puppet + module Acceptance + module CommandUtils + def ruby_command(host) + "env PATH=\"#{host['privatebindir']}:${PATH}\" ruby" + end + module_function :ruby_command + + def gem_command(host) + if host['platform'] =~ /windows/ + "env PATH=\"#{host['privatebindir']}:${PATH}\" cmd /c gem" + else + "env PATH=\"#{host['privatebindir']}:${PATH}\" gem" + end + end + module_function :gem_command + end + end +end diff -Nru facter-2.3.0/acceptance/lib/puppet/acceptance/install_utils.rb facter-2.4.6/acceptance/lib/puppet/acceptance/install_utils.rb --- facter-2.3.0/acceptance/lib/puppet/acceptance/install_utils.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/lib/puppet/acceptance/install_utils.rb 2016-01-26 18:41:33.000000000 +0000 @@ -1,16 +1,18 @@ require 'open-uri' require 'open3' require 'uri' +require 'puppet/acceptance/common_utils' module Puppet module Acceptance module InstallUtils PLATFORM_PATTERNS = { - :redhat => /fedora|el|centos/, :debian => /debian|ubuntu/, :debian_ruby18 => /debian|ubuntu-lucid|ubuntu-precise/, + :redhat => /fedora|el|centos/, + :sles => /sles/, :solaris => /solaris/, - :windows => /windows/, + :windows => /windows/ }.freeze # Installs packages on the hosts. @@ -114,9 +116,12 @@ end end - def install_repos_on(host, sha, repo_configs_dir) + def install_repos_on(host, project, sha, repo_configs_dir) platform = host['platform'].with_version_codename platform_configs_dir = File.join(repo_configs_dir,platform) + tld = sha == 'nightly' ? 'nightlies.puppetlabs.com' : 'builds.puppetlabs.lan' + project = sha == 'nightly' ? project + '-latest' : project + sha = sha == 'nightly' ? nil : sha case platform when /^(fedora|el|centos)-(\d+)-(.+)$/ @@ -131,38 +136,71 @@ platform_configs_dir ) - pattern = "pl-facter-%s-%s-%s%s-%s.repo" + pattern = "pl-%s%s-%s-%s%s-%s.repo" repo_filename = pattern % [ - sha, + project, + sha ? '-' + sha : '', variant, fedora_prefix, version, arch ] repo = fetch( - "http://builds.puppetlabs.lan/facter/%s/repo_configs/rpm/" % sha, + "http://%s/%s/%s/repo_configs/rpm/" % [tld, project, sha], repo_filename, platform_configs_dir ) - link = "http://builds.puppetlabs.lan/facter/%s/repos/%s/%s%s/products/%s/" % [sha, variant, fedora_prefix, version, arch] + link = "http://%s/%s/%s/repos/%s/%s%s/PC1/%s/" % [ + tld, + project, + sha, + variant, + fedora_prefix, + version, + arch + ] + + if not link_exists?(link) + link = "http://%s/%s/%s/repos/%s/%s%s/products/%s/" % [ + tld, + project, + sha, + variant, + fedora_prefix, + version, + arch + ] + end + if not link_exists?(link) - link = "http://builds.puppetlabs.lan/facter/%s/repos/%s/%s%s/devel/%s/" % [sha, variant, fedora_prefix, version, arch] + link = "http://%s/%s/%s/repos/%s/%s%s/devel/%s/" % [ + tld, + project, + sha, + variant, + fedora_prefix, + version, + arch + ] end + if not link_exists?(link) raise "Unable to reach a repo directory at #{link}" end repo_dir = fetch_remote_dir(link, platform_configs_dir) + repo_loc = "/root/#{project}" - on host, "rm -rf /root/*.repo; rm -rf /root/*.rpm; rm -rf /root/#{arch}" + on host, "rm -rf #{repo_loc}" + on host, "mkdir -p #{repo_loc}" - scp_to host, rpm, '/root' - scp_to host, repo, '/root' - scp_to host, repo_dir, '/root' - - on host, "mv /root/*.repo /etc/yum.repos.d" - on host, "find /etc/yum.repos.d/ -name \"*.repo\" -exec sed -i \"s/baseurl\\s*=\\s*http:\\/\\/builds.puppetlabs.lan.*$/baseurl=file:\\/\\/\\/root\\/#{arch}/\" {} \\;" - on host, "rpm -Uvh --force /root/*.rpm" + scp_to host, rpm, repo_loc + scp_to host, repo, repo_loc + scp_to host, repo_dir, repo_loc + + on host, "cp #{repo_loc}/*.repo /etc/yum.repos.d" + on host, "find /etc/yum.repos.d/ -name \"*.repo\" -exec sed -i \"s/baseurl\\s*=\\s*http:\\/\\/#{tld}.*$/baseurl=file:\\/\\/\\/root\\/#{project}\\/#{arch}/\" {} \\;" + on host, "rpm -Uvh --force #{repo_loc}/*.rpm" when /^(debian|ubuntu)-([^-]+)-(.+)$/ variant = $1 @@ -176,27 +214,72 @@ ) list = fetch( - "http://builds.puppetlabs.lan/facter/%s/repo_configs/deb/" % sha, - "pl-facter-%s-%s.list" % [sha, version], + "http://%s/%s/%s/repo_configs/deb/" % [tld, project, sha], + "pl-%s%s-%s.list" % [project, sha ? '-' + sha : '', version], platform_configs_dir ) - repo_dir = fetch_remote_dir("http://builds.puppetlabs.lan/facter/%s/repos/apt/%s" % [sha, version], platform_configs_dir) + repo_dir = fetch_remote_dir("http://%s/%s/%s/repos/apt/%s" % [tld, project, sha, version], platform_configs_dir) + repo_loc = "/root/#{project}" + + on host, "rm -rf #{repo_loc}" + on host, "mkdir -p #{repo_loc}" + + scp_to host, deb, repo_loc + scp_to host, list, repo_loc + scp_to host, repo_dir, repo_loc - on host, "rm -rf /root/*.list; rm -rf /root/*.deb; rm -rf /root/#{version}" + pc1_check = on(host, + "[[ -d /root/#{project}/#{version}/pool/PC1 ]]", + :acceptable_exit_codes => [0,1]) - scp_to host, deb, '/root' - scp_to host, list, '/root' - scp_to host, repo_dir, '/root' + repo_name = pc1_check.exit_code == 0 ? 'PC1' : 'main' - on host, "mv /root/*.list /etc/apt/sources.list.d" - on host, "find /etc/apt/sources.list.d/ -name \"*.list\" -exec sed -i \"s/deb\\s\\+http:\\/\\/builds.puppetlabs.lan.*$/deb file:\\/\\/\\/root\\/#{version} #{version} main/\" {} \\;" - on host, "dpkg -i --force-all /root/*.deb" + on host, "cp #{repo_loc}/*.list /etc/apt/sources.list.d" + on host, "find /etc/apt/sources.list.d/ -name \"*.list\" -exec sed -i \"s/deb\\s\\+http:\\/\\/#{tld}.*$/deb file:\\/\\/\\/root\\/#{project}\\/#{version} #{version} #{repo_name}/\" {} \\;" + on host, "dpkg -i --force-all #{repo_loc}/*.deb" on host, "apt-get update" else host.logger.notify("No repository installation step for #{platform} yet...") end end + + # Configures gem sources on hosts to use a mirror, if specified + # This is a duplicate of the Gemfile logic. + def configure_gem_mirror(hosts) + hosts = [hosts] unless hosts.kind_of?(Array) + gem_source = ENV['GEM_SOURCE'] || 'https://rubygems.org' + + hosts.each do |host| + case host['platform'] + when /windows/ + gem = 'cmd /c gem' + else + gem = 'gem' + end + + on host, "#{gem} source --clear-all" + on host, "#{gem} source --add #{gem_source}" + end + end + + def install_puppet_from_msi( host, opts ) + if not link_exists?(opts[:url]) + raise "Puppet does not exist at #{opts[:url]}!" + end + + # `start /w` blocks until installation is complete, but needs to be wrapped in `cmd.exe /c` + on host, "cmd.exe /c start /w msiexec /qn /i #{opts[:url]} /L*V C:\\\\Windows\\\\Temp\\\\Puppet-Install.log" + + # make sure the background service isn't running while the test executes + on host, "net stop puppet" + + # make sure install is sane, beaker has already added puppet and ruby + # to PATH in ~/.ssh/environment + on host, puppet('--version') + ruby = Puppet::Acceptance::CommandUtils.ruby_command(host) + on host, "#{ruby} --version" + end end end end diff -Nru facter-2.3.0/acceptance/Rakefile facter-2.4.6/acceptance/Rakefile --- facter-2.3.0/acceptance/Rakefile 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/Rakefile 2016-01-26 18:41:33.000000000 +0000 @@ -103,6 +103,7 @@ generate_config_for_latest_hosts if final_options[:preserve_hosts] || overriding_options =~ /--preserve-hosts/ end mv(options_file, "log/latest") + puts "\n\n" end end @@ -116,15 +117,19 @@ pre_suite_log = File.read('log/latest/pre_suite-run.log') nodes.each do |node_info| - hostname = /^(\w+) \(#{node_info[:node_label]}\)/.match(pre_suite_log)[1] - fqdn = "#{hostname}.delivery.puppetlabs.net" + possible_hostname_match = /^(\w+) \(#{node_info[:node_label]}\)/.match(pre_suite_log) + hostname = (possible_hostname_match || Array.new)[1] + fqdn = hostname ? "#{hostname}.delivery.puppetlabs.net" : "unknown" preserved_config_hash['HOSTS'][fqdn] = { 'roles' => [ 'agent'], 'platform' => node_info[:platform], } preserved_config_hash['HOSTS'][fqdn]['roles'].unshift('master') if node_info[:node_label] =~ /master/ end + + puts "\n\n" pp preserved_config_hash + puts "\n\n" File.open('log/latest/preserved_config.yaml', 'w') do |config_file| YAML.dump(preserved_config_hash, config_file) @@ -253,6 +258,14 @@ end desc <<-EOS +Run the acceptance tests through Beaker and install packages as part of the AIO puppet-agent installation. +#{USAGE} +EOS + task :aio => 'ci:check_env' do + beaker_test(:aio) + end + + desc <<-EOS Run the acceptance tests through Beaker and install from git on the configuration targets. #{USAGE} EOS @@ -272,7 +285,7 @@ #{USAGE} EOS task :test_and_preserve_hosts => 'ci:check_env' do - beaker_test(beaker_run_type, :preserve_hosts => true) + beaker_test(beaker_run_type, :preserve_hosts => 'always', :__preserve_config__ => true) end desc "List acceptance runs from the past day which had hosts preserved." @@ -310,7 +323,7 @@ beaker_test(beaker_run_type, :hosts_file => "#{config_path}/preserved_config.yaml", :no_provision => true, - :preserve_hosts => true, + :preserve_hosts => 'always', :pre_suite => ['setup/rsync/pre-suite'] ) end diff -Nru facter-2.3.0/acceptance/setup/aio/pre-suite/010_Install.rb facter-2.4.6/acceptance/setup/aio/pre-suite/010_Install.rb --- facter-2.3.0/acceptance/setup/aio/pre-suite/010_Install.rb 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/acceptance/setup/aio/pre-suite/010_Install.rb 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,43 @@ +require 'puppet/acceptance/install_utils' +extend Puppet::Acceptance::InstallUtils +require 'beaker/dsl/install_utils' +extend Beaker::DSL::InstallUtils + +test_name "Install Packages" + +step "Install repositories on target machines..." do + + sha = ENV['SHA'] + repo_configs_dir = 'repo-configs' + + hosts.each do |host| + install_repos_on(host, 'puppet-agent', sha, repo_configs_dir) + end +end + +PACKAGES = { + :redhat => [ + 'puppet-agent', + ], + :debian => [ + 'puppet-agent', + ], +# :solaris => [ +# 'puppet', +# ], +# :windows => [ +# 'puppet', +# ], +} + +install_packages_on(hosts, PACKAGES) + +agents.each do |agent| + if agent['platform'] =~ /windows/ + arch = agent[:ruby_arch] || 'x86' + base_url = ENV['MSI_BASE_URL'] || "http://builds.puppetlabs.lan/puppet-agent/#{ENV['SHA']}/artifacts/windows" + filename = ENV['MSI_FILENAME'] || "puppet-agent-#{arch}.msi" + + install_puppet_from_msi(agent, :url => "#{base_url}/#{filename}") + end +end diff -Nru facter-2.3.0/acceptance/setup/packages/pre-suite/010_Install.rb facter-2.4.6/acceptance/setup/packages/pre-suite/010_Install.rb --- facter-2.3.0/acceptance/setup/packages/pre-suite/010_Install.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/setup/packages/pre-suite/010_Install.rb 2016-01-26 18:41:33.000000000 +0000 @@ -11,7 +11,7 @@ repo_configs_dir = 'repo-configs' hosts.each do |host| - install_repos_on(host, sha, repo_configs_dir) + install_repos_on(host, 'facter', sha, repo_configs_dir) end end diff -Nru facter-2.3.0/acceptance/tests/operatingsystem_detection_after_clear_on_ubuntu.rb facter-2.4.6/acceptance/tests/operatingsystem_detection_after_clear_on_ubuntu.rb --- facter-2.3.0/acceptance/tests/operatingsystem_detection_after_clear_on_ubuntu.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/tests/operatingsystem_detection_after_clear_on_ubuntu.rb 2016-01-26 18:41:33.000000000 +0000 @@ -14,5 +14,5 @@ create_remote_file(agent, script_name, script_contents) - on(agent, "ruby #{script_name}") + on(agent, "#{agent['privatebindir']}/ruby #{script_name}") end diff -Nru facter-2.3.0/acceptance/tests/runs_external_facts_once.rb facter-2.4.6/acceptance/tests/runs_external_facts_once.rb --- facter-2.3.0/acceptance/tests/runs_external_facts_once.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/acceptance/tests/runs_external_facts_once.rb 2016-01-26 18:41:33.000000000 +0000 @@ -24,7 +24,7 @@ ext = '.bat' content = win_content else - factsd = '/etc/facter/facts.d' + factsd = '/opt/puppetlabs/facter/facts.d' ext = '.sh' content = unix_content end diff -Nru facter-2.3.0/debian/changelog facter-2.4.6/debian/changelog --- facter-2.3.0/debian/changelog 2015-01-21 19:33:25.000000000 +0000 +++ facter-2.4.6/debian/changelog 2016-01-27 21:09:21.000000000 +0000 @@ -1,35 +1,28 @@ -facter (2.3.0-0ubuntu1) vivid; urgency=medium +facter (2.4.6-1) unstable; urgency=medium - * New upstream release - * d/p/kvm-cpuinfo: updated + * Imported upstream release 2.4.6 - -- Ryan Harper Wed, 21 Jan 2015 13:32:15 -0600 + -- Stig Sandbeck Mathisen Wed, 27 Jan 2016 22:09:18 +0100 -facter (2.1.0-1ubuntu1) utopic; urgency=medium +facter (2.4.4-1) unstable; urgency=medium - * Merge from Debian testing. Remaining changes: - - d/control: virt-what is not in main, so move Depends to Suggests. - - d/control, d/tests: add dep8 smoke test. - - d/p/kvm-cpuinfo: detect "Common KVM processor" in /proc/cpuinfo as - virtual (LP: #1170325). + * Imported upstream release 2.4.4 + * [c0394ac] Add DEP-8 tests + * [9830e32] Update packaging URLs and upstream information - -- Robie Basak Tue, 15 Jul 2014 13:34:19 +0000 + -- Stig Sandbeck Mathisen Tue, 01 Dec 2015 21:04:27 +0100 -facter (2.1.0-1) unstable; urgency=medium +facter (2.2.0-1) unstable; urgency=medium - * Imported upstream release 2.1.0 + * Imported upstream release 2.2.0 - -- Stig Sandbeck Mathisen Mon, 30 Jun 2014 16:55:08 +0200 + -- Stig Sandbeck Mathisen Tue, 26 Aug 2014 09:41:22 +0200 -facter (2.0.1-1ubuntu1) utopic; urgency=medium +facter (2.1.0-1) unstable; urgency=medium - * Merge from Debian testing. Remaining changes: - - d/control: virt-what is not in main, so move Depends to Suggests. - - d/control, d/tests: add dep8 smoke test. - - d/p/kvm-cpuinfo: detect "Common KVM processor" in /proc/cpuinfo as - virtual. + * Imported upstream release 2.1.0 - -- Robie Basak Fri, 09 May 2014 18:10:31 +0000 + -- Stig Sandbeck Mathisen Mon, 30 Jun 2014 16:55:08 +0200 facter (2.0.1-1) unstable; urgency=medium @@ -38,16 +31,6 @@ -- Stig Sandbeck Mathisen Mon, 07 Apr 2014 00:12:31 +0200 -facter (1.7.3-1ubuntu1) trusty; urgency=medium - - * Merge from Debian unstable. Remaining changes: - - d/control: virt-what is not in main, so move Depends to Suggests. - - d/control, d/tests: add dep8 smoke test. - - d/p/kvm-cpuinfo: detect "Common KVM processor" in /proc/cpuinfo as - virtual (LP: #1170325). - - -- Robie Basak Tue, 21 Jan 2014 14:36:17 +0000 - facter (1.7.3-1) unstable; urgency=low * Imported upstream version 1.7.3 @@ -56,48 +39,12 @@ -- Stig Sandbeck Mathisen Mon, 04 Nov 2013 15:57:00 +0100 -facter (1.7.2-1ubuntu1) trusty; urgency=low - - * Merge from Debian unstable (LP: #1246416). Remaining changes: - - d/control: virt-what is not in main, so move Depends to Suggests. - - d/control, d/tests: add dep8 smoke test. - - d/p/kvm-cpuinfo: detect "Common KVM processor" in /proc/cpuinfo as - virtual (LP: #1170325). - * Move ruby-json back to Depends (dropping the delta with debian) as it - is now in main. - - -- Andres Rodriguez Wed, 30 Oct 2013 13:22:31 -0400 - facter (1.7.2-1) unstable; urgency=low * Imported upstream version 1.7.2 -- Stig Sandbeck Mathisen Sun, 01 Sep 2013 13:03:51 +0200 -facter (1.7.0-1ubuntu1) saucy; urgency=low - - * Merge from Debian unstable (LP: #1173265). Remaining changes: - - debian/control: ruby-json is not in main, so move Depends to Suggests. - * Dropped changes: - - gem2deb and ruby-pkg-tools are now in main: - + use what we had in natty; we don't want ruby-pkg-tools - in main. (LP: #408402) - + Continue using ruby + libopenssl-ruby as Build-Depends even tho Debian - has moved to gem2deb (not in main). - - No longer necessary: - + Use dh_prep instead of dh_clean, add build-arch + build-indep targets - - Debian packaging now supports multiple Ruby versions: - + Make binary package depend on ruby1.8 explicitly - - Applied in Debian: - + debian/patches/ubuntu_xen_print_virtual.patch: correctly detect - xen0,xenu. (LP: #980291) - * d/control: virt-what is not in main, so move Depends to Suggests. - * d/control, d/tests: add dep8 smoke test. - * d/p/kvm-cpuinfo: detect "Common KVM processor" in /proc/cpuinfo as virtual - (LP: #1170325). - - -- Robie Basak Mon, 20 May 2013 14:09:11 +0000 - facter (1.7.0-1) unstable; urgency=low [ Micah Anderson ] @@ -117,22 +64,6 @@ -- Stig Sandbeck Mathisen Sun, 24 Jun 2012 13:01:40 +0200 -facter (1.6.9-2ubuntu1) quantal; urgency=low - - * Merge from Debian unstable (LP: #1007560). Remaining changes: - - debian/rules: - + use what we had in natty; we don't want ruby-pkg-tools - in main. (LP: #408402) - + Use dh_prep instead of dh_clean, add build-arch + build-indep targets - - debian/control: - + Continue using ruby + libopenssl-ruby as Build-Depends even tho Debian - has moved to gem2deb (not in main). Move ruby-json to Suggests. - + Make binary package depend on ruby1.8 explicitly - * debian/patches/ubuntu_xen_print_virtual.patch: correctly detect - xen0,xenu. (LP: #980291) - - -- Andres Rodriguez Fri, 01 Jun 2012 14:51:28 -0400 - facter (1.6.9-2) unstable; urgency=medium * Add patch from upstream (b050eb1) to ignore LSB noise @@ -164,42 +95,12 @@ -- Stig Sandbeck Mathisen Mon, 27 Feb 2012 16:45:49 +0100 -facter (1.6.5-1ubuntu1) precise; urgency=low - - * Merge from Debian testing. Remaining changes: - - debian/rules: use what we had in natty; we don't want ruby-pkg-tools - in main. (LP: #408402) - - debian/control: Continue using ruby + libopenssl-ruby as Build-Depends - even tho Debian has moved to gem2deb (not in main). Move ruby-json to - Suggests. - - debian/rules: Use dh_prep instead of dh_clean, add build-arch + - build-indep targets - - debian/control: Make binary package depend on ruby1.8 explicitly - - -- Chuck Short Sun, 12 Feb 2012 20:40:24 -0500 - facter (1.6.5-1) unstable; urgency=low * New upstream release -- Stig Sandbeck Mathisen Thu, 26 Jan 2012 11:11:13 +0100 -facter (1.6.4-2ubuntu1) precise; urgency=low - - * Merge from Debian testing (LP: #922788). Remaining changes: - - debian/rules: use what we had in natty; we don't want ruby-pkg-tools - in main. (LP: #408402) - - debian/control: Continue using ruby + libopenssl-ruby as Build-Depends - even tho Debian has moved to gem2deb (not in main). Move ruby-json to - Suggests. - - debian/rules: Use dh_prep instead of dh_clean, add build-arch + - build-indep targets - - debian/control: Make binary package depend on ruby1.8 explicitly. - * Dropped changes: - - debian/control: Update debhelper Build-Depends to 8 (Updated in Debian) - - -- Adam Gandelman Fri, 27 Jan 2012 11:05:12 -0800 - facter (1.6.4-2) unstable; urgency=low * Move dmidecode from Depends to Recommends (Closes: #651501) @@ -219,38 +120,12 @@ -- Stig Sandbeck Mathisen Tue, 22 Nov 2011 21:44:38 +0100 -facter (1.6.2-1ubuntu1) precise; urgency=low - - * Merge from Debian testing (LP: #888671). Remaining changes: - - debian/rules: use what we had in natty; we don't want ruby-pkg-tools - in main. (LP: #408402) - - debian/control: Continue using ruby + libopenssl-ruby as Build-Depends - even tho Debian has moved to gem2deb (not in main). Move ruby-json to - Suggests. - * debian/rules: Use dh_prep instead of dh_clean, add build-arch + build-indep - targets - * debian/control: Update debhelper Build-Depends to 8, make binary package - depend on ruby1.8 explicitly. - - -- Adam Gandelman Thu, 10 Nov 2011 10:11:05 -0800 - facter (1.6.2-1) unstable; urgency=low * New upstream release -- Stig Sandbeck Mathisen Wed, 12 Oct 2011 11:29:53 +0200 -facter (1.6.1-1ubuntu1) precise; urgency=low - - * Merge from Debian unstable (LP: #877621). Remaining changes: - - debian/rules: use what we had in natty; we don't want ruby-pkg-tools - in main. (LP: #408402) - * debian/control: Continue using ruby + libopenssl-ruby as Build-Depends - even tho Debian has moved to gem2deb (not in main). Move ruby-json to - Suggests. - - -- Adam Gandelman Tue, 18 Oct 2011 10:32:42 -0700 - facter (1.6.1-1) unstable; urgency=low * New upstream release @@ -267,16 +142,6 @@ -- Stig Sandbeck Mathisen Fri, 24 Jun 2011 10:04:12 +0200 -facter (1.5.9-1ubuntu1) oneiric; urgency=low - - * Merge from debian unstable (LP: #788284). Remaining changes: - - Dropped ruby-pkg-tools and libsetup-ruby1.8; debian/rules: use what we - had in natty; we don't want ruby-pkg-tools in main. (LP: #408402) - * Dropped changes to lib/facter/ec2.rb. (Use the latest-meta api so it - always does not retunr false). This was fixed upstream. - - -- Andres Rodriguez Fri, 27 May 2011 11:27:00 +0100 - facter (1.5.9-1) unstable; urgency=low * New upstream release @@ -291,21 +156,6 @@ -- Stig Sandbeck Mathisen Fri, 18 Mar 2011 12:06:08 +0100 -facter (1.5.8-2ubuntu2) natty; urgency=low - - * lib/facter/ec2.rb: Use the latest-meta api so it always - does not return false. (LP: #732953) - - -- Chuck Short Mon, 04 Apr 2011 11:34:30 -0400 - -facter (1.5.8-2ubuntu1) natty; urgency=low - - * Merge from debian unstable. Remaining changes: - - Dropped ruby-pkg-tools and libsetup-ruby1.8, we don't want ruby-pkg-tools - in main. (LP: #408402) - - -- Chuck Short Tue, 08 Feb 2011 00:18:35 +0000 - facter (1.5.8-2) unstable; urgency=low * Release for unstable @@ -336,52 +186,6 @@ -- Stig Sandbeck Mathisen Wed, 01 Dec 2010 16:02:13 +0100 -facter (1.5.7-3ubuntu1) natty; urgency=low - - * Merge from debian unstable, remaining changes are: - - Dropped ruby-pkg-tools and libsetup-ruby1.8, we don't want ruby-pkg-tools - in main. (LP: #408402) - - -- Chuck Short Mon, 10 Jan 2011 11:25:00 -0500 - -facter (1.5.7-3) unstable; urgency=low - - * Remove unnecessary alternate dependency on libopenssl-ruby1.9 - * Fix 1.5.7-2 changelog, correcting bug number for #545867 - - -- Micah Anderson Fri, 17 Dec 2010 12:17:49 -0500 - -facter (1.5.7-2) unstable; urgency=low - - [ Stig Sandbeck Mathisen ] - * Fix "upgrade from 1.3.5 to 1.5.1 requires puppet to be restarted", - added a note in debian/NEWS about restarting puppet (Closes: #515726) - * debian/control: bump standards version: no changes - * debian/control: Remove unused build dependency on "cdbs" - * Add versioned dependency for ruby1.8 (Closes: #545867) - * Cherry-pick domain/fqdn fact fix from upstream (Closes: #515591) - - [ Micah Anderson ] - * debian/control: add Vcs-Git, Vcs-Browser, and Homepage fields - * debian/NEWS: fix lintian syntax-error-in-debian-news-file - * debian/facter.8: fix manpage-section-mismatch - * cherry pick upstream virtualization support: - . openvz fix [#4156] - . add kvm support (Closes: #603001) - . fix Linux-Vserver of virtual fact [#3397] - . add xendomains fact - - -- Micah Anderson Wed, 15 Dec 2010 00:21:46 -0500 - -facter (1.5.7-1ubuntu1) maverick; urgency=low - - * Merge from debian testing. Remaining changes: - - Dropped ruby-pkg-tools, and libsetup-ruby1.8, and cdbs, use what - we had in lucid. Since we don't want ruby-pkg-tools in main - (LP: #408402) - - -- Chuck Short Fri, 26 Mar 2010 16:14:26 +0000 - facter (1.5.7-1) unstable; urgency=low * New upstream version 1.5.7 @@ -404,21 +208,6 @@ -- Stig Sandbeck Mathisen Fri, 25 Dec 2009 00:41:25 +0100 -facter (1.5.6-2ubuntu2) lucid; urgency=low - - * Dropped ruby-pkg-tools, and libsetup-ruby1.8, and cdbs, use what - we had in karmic. Since we don't want ruby-pkg-tools in main. - (LP: #408402) - - -- Chuck Short Fri, 26 Mar 2010 08:34:25 -0400 - -facter (1.5.6-2ubuntu1) lucid; urgency=low - - * Merge from debian testing, remaining changes: - - Use bind9-host9 only. - - -- Chuck Short Fri, 06 Nov 2009 00:52:19 +0000 - facter (1.5.6-2) unstable; urgency=low * Added depends possibility on libopenssl-ruby1.9 @@ -440,12 +229,6 @@ -- Micah Anderson Mon, 29 Jun 2009 22:53:18 -0400 -facter (1.5.4-1ubuntu1) karmic; urgency=low - - * Use bind9-host9 only. - - -- Chuck Short Mon, 03 Aug 2009 09:51:59 -0400 - facter (1.5.4-1) unstable; urgency=low [ Nigel Kersten ] diff -Nru facter-2.3.0/debian/control facter-2.4.6/debian/control --- facter-2.3.0/debian/control 2014-07-15 13:44:01.000000000 +0000 +++ facter-2.4.6/debian/control 2015-12-01 20:03:35.000000000 +0000 @@ -1,17 +1,15 @@ Source: facter Section: admin Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Puppet Package Maintainers +Maintainer: Puppet Package Maintainers Uploaders: Andrew Pollock , Nigel Kersten , Micah Anderson , Stig Sandbeck Mathisen Build-Depends: debhelper (>= 8), ruby | ruby-interpreter, Standards-Version: 3.9.5 Vcs-Git: git://anonscm.debian.org/pkg-puppet/facter.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-puppet/facter.git -Homepage: http://projects.puppetlabs.com/projects/facter -XS-Testsuite: autopkgtest +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-puppet/facter.git +Homepage: https://tickets.puppetlabs.com/browse/FACT/ Package: facter Architecture: all @@ -20,8 +18,7 @@ net-tools, ruby-json, ruby | ruby-interpreter, -Recommends: pciutils, dmidecode -Suggests: virt-what +Recommends: pciutils, dmidecode, virt-what Description: collect and display facts about the system A cross-platform Ruby library for retrieving facts from operating systems. Supports multiple resolution mechanisms, any of which can be restricted to diff -Nru facter-2.3.0/debian/patches/kvm-cpuinfo facter-2.4.6/debian/patches/kvm-cpuinfo --- facter-2.3.0/debian/patches/kvm-cpuinfo 2015-01-21 19:23:10.000000000 +0000 +++ facter-2.4.6/debian/patches/kvm-cpuinfo 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Author: rustx -Bug: https://github.com/puppetlabs/facter/pull/419 -Bug-Ubuntu: https://launchpad.net/bugs/1170325 -Description: detect "Common KVM processor" in /proc/cpuinfo as virtual -Forwarded: not-needed -Last-Update: 2015-01-21 - -It looks like this was originally implemented upstream in a buggy way to me, -then merged, reverted and merged again upstream, with a correction along the -way. The patch is so trivial that I think that taking rustx's patch as-is is -the easiest way to fix this for now, rather than trying to cherry-pick all the -appropriate upstream commits. The issue is already fixed upstream, so this can -be dropped when we update to the latest upstream release anyway. --rbasak - ---- a/lib/facter/util/virtual.rb -+++ b/lib/facter/util/virtual.rb -@@ -106,7 +106,7 @@ - elsif Facter.value(:kernel) == "SunOS" and FileTest.exists?("/usr/sbin/prtconf") - Facter::Core::Execution.exec("/usr/sbin/prtconf -v") - end -- (txt =~ /QEMU Virtual (CPU|Machine)/i) ? true : false -+ (txt =~ /QEMU Virtual (CPU|Machine)|Common KVM processor/i) ? true : false - end - - def self.virtualbox? diff -Nru facter-2.3.0/debian/patches/series facter-2.4.6/debian/patches/series --- facter-2.3.0/debian/patches/series 2015-01-21 19:18:50.000000000 +0000 +++ facter-2.4.6/debian/patches/series 2015-12-01 19:48:42.000000000 +0000 @@ -1,2 +1 @@ 0001-Do-not-require-rubygems.patch -kvm-cpuinfo diff -Nru facter-2.3.0/debian/tests/control facter-2.4.6/debian/tests/control --- facter-2.3.0/debian/tests/control 2014-07-15 13:29:21.000000000 +0000 +++ facter-2.4.6/debian/tests/control 2015-12-01 19:56:35.000000000 +0000 @@ -1 +1,2 @@ -Tests: smoke +Tests: run +Depends: @ diff -Nru facter-2.3.0/debian/tests/run facter-2.4.6/debian/tests/run --- facter-2.3.0/debian/tests/run 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/debian/tests/run 2015-12-01 19:58:54.000000000 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +facter --json facterversion diff -Nru facter-2.3.0/debian/tests/smoke facter-2.4.6/debian/tests/smoke --- facter-2.3.0/debian/tests/smoke 2014-07-15 13:29:21.000000000 +0000 +++ facter-2.4.6/debian/tests/smoke 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!/bin/sh -set -e - -result=`facter osfamily` -if [ "$result" != Debian ]; then - echo "\"facter osfamily\" returned \"$result\" instead of \"Debian\"" >&2 - exit 1 -fi diff -Nru facter-2.3.0/debian/upstream/metadata facter-2.4.6/debian/upstream/metadata --- facter-2.3.0/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/debian/upstream/metadata 2015-12-01 19:48:42.000000000 +0000 @@ -0,0 +1,6 @@ +Bug-Database: https://tickets.puppetlabs.com/browse/FACT/?selectedTab=com.atlassian.jira.jira-projects-plugin:issues-panel +Changelog: https://tickets.puppetlabs.com/browse/FACT/?selectedTab=com.atlassian.jira.jira-projects-plugin:changelog-panel +Name: facter +Repository: https://github.com/puppetlabs/facter.git +Repository-Browse: https://github.com/puppetlabs/facter +Security-Contact: Puppet Labs Security Team diff -Nru facter-2.3.0/debian/upstream/signing-key.asc facter-2.4.6/debian/upstream/signing-key.asc --- facter-2.3.0/debian/upstream/signing-key.asc 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/debian/upstream/signing-key.asc 2015-12-01 19:48:42.000000000 +0000 @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1 + +mQINBEw3u0ABEAC1+aJQpU59fwZ4mxFjqNCgfZgDhONDSYQFMRnYC1dzBpJHzI6b +fUBQeaZ8rh6N4kZ+wq1eL86YDXkCt4sCvNTP0eF2XaOLbmxtV9bdpTIBep9bQiKg +5iZaz+brUZlFk/MyJ0Yz//VQ68N1uvXccmD6uxQsVO+gx7rnarg/BGuCNaVtGwy+ +S98g8Begwxs9JmGa8pMCcSxtC7fAfAEZ02cYyrw5KfBvFI3cHDdBqrEJQKwKeLKY +GHK3+H1TM4ZMxPsLuR/XKCbvTyl+OCPxU2OxPjufAxLlr8BWUzgJv6ztPe9imqpH +Ppp3KuLFNorjPqWY5jSgKl94W/CO2x591e++a1PhwUn7iVUwVVe+mOEWnK5+Fd0v +VMQebYCXS+3dNf6gxSvhz8etpw20T9Ytg4EdhLvCJRV/pYlqhcq+E9le1jFOHOc0 +Nc5FQweUtHGaNVyn8S1hvnvWJBMxpXq+Bezfk3X8PhPT/l9O2lLFOOO08jo0OYiI +wrjhMQQOOSZOb3vBRvBZNnnxPrcdjUUm/9cVB8VcgI5KFhG7hmMCwH70tpUWcZCN +NlI1wj/PJ7Tlxjy44f1o4CQ5FxuozkiITJvh9CTg+k3wEmiaGz65w9jRl9ny2gEl +f4CR5+ba+w2dpuDeMwiHJIs5JsGyJjmA5/0xytB7QvgMs2q25vWhygsmUQARAQAB +tEdQdXBwZXQgTGFicyBSZWxlYXNlIEtleSAoUHVwcGV0IExhYnMgUmVsZWFzZSBL +ZXkpIDxpbmZvQHB1cHBldGxhYnMuY29tPokCPgQTAQIAKAIbAwYLCQgHAwIGFQgC +CQoLBBYCAwECHgECF4AFAk/x5PoFCQtIMjoACgkQEFS3okvW7DAIKQ/9HvZyf+LH +VSkCk92Kb6gckniin3+5ooz67hSr8miGBfK4eocqQ0H7bdtWjAILzR/IBY0xj6OH +KhYP2k8TLc7QhQjt0dRpNkX+Iton2AZryV7vUADreYz44B0bPmhiE+LL46ET5ITh +LKu/KfihzkEEBa9/t178+dO9zCM2xsXaiDhMOxVE32gXvSZKP3hmvnK/FdylUY3n +WtPedr+lHpBLoHGaPH7cjI+MEEugU3oAJ0jpq3V8n4w0jIq2V77wfmbD9byIV7dX +cxApzciK+ekwpQNQMSaceuxLlTZKcdSqo0/qmS2A863YZQ0ZBe+Xyf5OI33+y+Mr +y+vl6Lre2VfPm3udgR10E4tWXJ9Q2CmG+zNPWt73U1FD7xBI7PPvOlyzCX4QJhy2 +Fn/fvzaNjHp4/FSiCw0HvX01epcersyun3xxPkRIjwwRM9m5MJ0o4hhPfa97zibX +Sh8XXBnosBQxeg6nEnb26eorVQbqGx0ruu/W2m5/JpUfREsFmNOBUbi8xlKNS5CZ +ypH3Zh88EZiTFolOMEh+hT6s0l6znBAGGZ4m/Unacm5yDHmg7unCk4JyVopQ2KHM +oqG886elu+rm0ASkhyqBAk9sWKptMl3NHiYTRE/m9VAkugVIB2pi+8u84f+an4Hm +l4xlyijgYu05pqNvnLRyJDLd61hviLC8GYU= +=qHKb +-----END PGP PUBLIC KEY BLOCK----- diff -Nru facter-2.3.0/debian/watch facter-2.4.6/debian/watch --- facter-2.3.0/debian/watch 2014-05-09 17:23:03.000000000 +0000 +++ facter-2.4.6/debian/watch 2015-12-01 19:50:30.000000000 +0000 @@ -1,3 +1,5 @@ version=3 -opts=uversionmangle=s{(.*(?:alpha|beta|rc).*)}{~$1} \ -http://downloads.puppetlabs.com/facter/facter-(\S+)\.tar\.gz +opts=\ +uversionmangle=s{(.*(?:alpha|beta|rc).*)}{~$1},\ +pgpsigurlmangle=s/$/.asc/ \ +http://downloads.puppetlabs.com/facter/facter-(2\.\S+)\.tar\.gz diff -Nru facter-2.3.0/ext/build_defaults.yaml facter-2.4.6/ext/build_defaults.yaml --- facter-2.3.0/ext/build_defaults.yaml 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/ext/build_defaults.yaml 2016-01-26 18:41:33.000000000 +0000 @@ -2,14 +2,14 @@ packaging_url: 'git://github.com/puppetlabs/packaging.git --branch=master' packaging_repo: 'packaging' default_cow: 'base-squeeze-i386.cow' -cows: 'base-lucid-i386.cow base-lucid-amd64.cow base-precise-i386.cow base-precise-amd64.cow base-squeeze-i386.cow base-squeeze-amd64.cow base-stable-i386.cow base-stable-amd64.cow base-testing-i386.cow base-testing-amd64.cow base-trusty-i386.cow base-trusty-amd64.cow base-wheezy-i386.cow base-wheezy-amd64.cow' +cows: 'base-precise-i386.cow base-precise-amd64.cow base-squeeze-i386.cow base-squeeze-amd64.cow base-trusty-i386.cow base-trusty-amd64.cow base-wheezy-i386.cow base-wheezy-amd64.cow' pbuild_conf: '/etc/pbuilderrc' packager: 'puppetlabs' gpg_name: 'info@puppetlabs.com' gpg_key: '4BD6EC30' sign_tar: FALSE # a space separated list of mock configs -final_mocks: 'pl-el-5-i386 pl-el-5-x86_64 pl-el-6-i386 pl-el-6-x86_64 pl-el-7-x86_64 pl-fedora-19-i386 pl-fedora-19-x86_64 pl-fedora-20-i386 pl-fedora-20-x86_64' +final_mocks: 'pl-el-5-i386 pl-el-5-x86_64 pl-el-6-i386 pl-el-6-x86_64 pl-el-7-x86_64 pl-fedora-20-i386 pl-fedora-20-x86_64' yum_host: 'yum.puppetlabs.com' yum_repo_path: '/opt/repository/yum/' build_gem: TRUE diff -Nru facter-2.3.0/ext/debian/changelog facter-2.4.6/ext/debian/changelog --- facter-2.3.0/ext/debian/changelog 2014-10-30 20:50:48.000000000 +0000 +++ facter-2.4.6/ext/debian/changelog 2016-01-26 18:41:38.000000000 +0000 @@ -1,8 +1,8 @@ -facter (2.3.0-1puppetlabs1) lucid unstable sid wheezy lucid squeeze precise quantal raring; urgency=low +facter (2.4.6-1puppetlabs1) lucid unstable sid wheezy lucid squeeze precise quantal raring; urgency=low * Update to version - -- Puppet Labs Release Thu, 30 Oct 2014 13:50:48 -0700 + -- Puppet Labs Release Tue, 26 Jan 2016 10:41:38 -0800 facter (1.7.2-1puppetlabs2) lucid unstable sid wheezy lucid squeeze precise; urgency=low diff -Nru facter-2.3.0/ext/ips/facter.p5m facter-2.4.6/ext/ips/facter.p5m --- facter-2.3.0/ext/ips/facter.p5m 2014-10-30 20:50:48.000000000 +0000 +++ facter-2.4.6/ext/ips/facter.p5m 2016-01-26 18:41:38.000000000 +0000 @@ -1,6 +1,6 @@ -set name=pkg.fmri value=pkg://puppetlabs.com/application/@2.3.0,13.4.0-0 +set name=pkg.fmri value=pkg://puppetlabs.com/application/@2.4.6,14.5.0-0 set name=pkg.summary value="Facter, a system inventory tool" -set name=pkg.human-version value="2.3.0" +set name=pkg.human-version value="2.4.6" set name=pkg.description value="You can prove anything with facts!" set name=info.classification value="org.opensolaris.category.2008:Applications/System Utilities" set name=org.opensolaris.consolidation value="puppet" diff -Nru facter-2.3.0/ext/redhat/facter.spec facter-2.4.6/ext/redhat/facter.spec --- facter-2.3.0/ext/redhat/facter.spec 2014-10-30 20:50:48.000000000 +0000 +++ facter-2.4.6/ext/redhat/facter.spec 2016-01-26 18:41:38.000000000 +0000 @@ -7,8 +7,8 @@ %endif # VERSION is subbed out during rake srpm process -%global realversion 2.3.0 -%global rpmversion 2.3.0 +%global realversion 2.4.6 +%global rpmversion 2.4.6 Summary: Ruby module for collecting simple facts about a host operating system Name: facter @@ -73,8 +73,8 @@ %changelog -* Thu Oct 30 2014 Puppet Labs Release - 1:2.3.0-1 -- Build for 2.3.0 +* Tue Jan 26 2016 Puppet Labs Release - 1:2.4.6-1 +- Build for 2.4.6 * Mon Apr 01 2013 Matthaus Owens - 1:1.7.0-0.1rc1 - Add dependency on virt-what to facter for better virutalization detection diff -Nru facter-2.3.0/Gemfile facter-2.4.6/Gemfile --- facter-2.3.0/Gemfile 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/Gemfile 2016-01-26 18:41:33.000000000 +0000 @@ -9,6 +9,7 @@ end group :development, :test do + gem 'yarjuf', "~> 1.0" gem 'rake', "~> 10.1.0" gem 'rspec', "~> 2.11.0" gem 'mocha', "~> 0.10.5" diff -Nru facter-2.3.0/lib/facter/application.rb facter-2.4.6/lib/facter/application.rb --- facter-2.3.0/lib/facter/application.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/application.rb 2016-01-26 18:41:33.000000000 +0000 @@ -160,7 +160,9 @@ "Enable timing.") { |v| Facter.timing(1) } opts.on("-p", "--puppet", - "Load the Puppet libraries, thus allowing Facter to load Puppet-specific facts.") { |v| load_puppet } + "(Deprecated: use `puppet facts` instead) Load the Puppet libraries, thus allowing Facter to load Puppet-specific facts.") do |v| + load_puppet + end opts.on_tail("-v", "--version", @@ -187,7 +189,7 @@ def self.load_puppet require 'puppet' - Puppet.parse_config + Puppet.initialize_settings # If you've set 'vardir' but not 'libdir' in your # puppet.conf, then the hook to add libdir to $: diff -Nru facter-2.3.0/lib/facter/core/execution/posix.rb facter-2.4.6/lib/facter/core/execution/posix.rb --- facter-2.3.0/lib/facter/core/execution/posix.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/core/execution/posix.rb 2016-01-26 18:41:33.000000000 +0000 @@ -11,11 +11,11 @@ def which(bin) if absolute_path?(bin) - return bin if File.executable?(bin) + return bin if File.executable?(bin) and File.file?(bin) else search_paths.each do |dir| dest = File.join(dir, bin) - return dest if File.executable?(dest) + return dest if File.executable?(dest) and File.file?(dest) end end nil diff -Nru facter-2.3.0/lib/facter/core/logging.rb facter-2.4.6/lib/facter/core/logging.rb --- facter-2.3.0/lib/facter/core/logging.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/core/logging.rb 2016-01-26 18:41:33.000000000 +0000 @@ -21,6 +21,22 @@ # @api private @@debug_messages = {} + # @api private + @@message_callback = nil + + # Used to register a callback that is called when a message is logged. + # If a block is given, Facter will not log messages. + # If a block is not given, Facter will resume logging messages. + # @param block [Proc] the callback to call when a message is logged. + # The first argument to the callback will be a symbol representing a level. The supported + # levels are: :trace, :debug, :info, :warn, :error, and :fatal. + # The second argument to the callback will be a string containing the message + # that was logged. + # @api public + def on_message(&block) + @@message_callback = block + end + # Prints a debug message if debugging is turned on # # @param msg [String] the debug message @@ -30,6 +46,8 @@ if msg.nil? or msg.empty? invoker = caller[0].slice(/.*:\d+/) self.warn "#{self.class}#debug invoked with invalid message #{msg.inspect}:#{msg.class} at #{invoker}" + elsif @@message_callback + @@message_callback.call(:debug, msg) else puts GREEN + msg + RESET end @@ -59,7 +77,10 @@ def warn(msg) if msg.nil? or msg.empty? invoker = caller[0].slice(/.*:\d+/) - Kernel.warn "#{self.class}#debug invoked with invalid message #{msg.inspect}:#{msg.class} at #{invoker}" + msg = "#{self.class}#debug invoked with invalid message #{msg.inspect}:#{msg.class} at #{invoker}" + end + if @@message_callback + @@message_callback.call(:warn, msg) else Kernel.warn msg end @@ -111,7 +132,13 @@ # # @api private def show_time(string) - $stderr.puts "#{GREEN}#{string}#{RESET}" if string and self.timing? + return unless string && self.timing? + + if @@message_callback + @@message_callback.call(:info, string) + else + $stderr.puts "#{GREEN}#{string}#{RESET}" + end end # Enable or disable logging of debug messages @@ -158,12 +185,13 @@ @@trace end - # Clears the seen state of warning messages. See {warnonce}. + # Clears the seen state of debug and warning messages. See {debugonce} and {warnonce}. # # @return [void] # # @api private def clear_messages + @@debug_messages.clear @@warn_messages.clear end end diff -Nru facter-2.3.0/lib/facter/dhcp_servers.rb facter-2.4.6/lib/facter/dhcp_servers.rb --- facter-2.3.0/lib/facter/dhcp_servers.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/dhcp_servers.rb 2016-01-26 18:41:33.000000000 +0000 @@ -5,6 +5,8 @@ # If the interface that is the default gateway is DHCP assigned, there # will also be a `"system"` entry in the hash. # +# This fact is structured. Values are returned as a group of key-value pairs. +# # Resolution: # Parses the output of `nmcli` to find the DHCP server for the interface if available. # @@ -21,6 +23,10 @@ confine do Facter::Core::Execution.which('nmcli') end + confine do + s = Facter::Util::DHCPServers.network_manager_state + !s.empty? && (s != 'unknown') + end setcode do gwdev = Facter::Util::DHCPServers.gateway_device diff -Nru facter-2.3.0/lib/facter/ec2/rest.rb facter-2.4.6/lib/facter/ec2/rest.rb --- facter-2.3.0/lib/facter/ec2/rest.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/ec2/rest.rb 2016-01-26 18:41:33.000000000 +0000 @@ -13,6 +13,11 @@ Errno::ETIMEDOUT, ] + # Contains metadata keys that should not be collected + FILTERED_KEYS = [ + 'security-credentials/' + ].freeze + class Base def reachable?(retry_limit = 3) timeout = 0.2 @@ -56,6 +61,7 @@ keys = fetch_endpoint(path) keys.each do |key| + next if FILTERED_KEYS.include? key if key.match(%r[/$]) # If a metadata key is suffixed with '/' then it's a general metadata # resource, so we have to recursively look up all the keys in the given @@ -90,6 +96,9 @@ rescue *CONNECTION_ERRORS => e Facter.log_exception(e, "Failed to fetch ec2 uri #{uri}: #{e.message}") return nil + rescue Timeout::Error => e + Facter.log_exception(e, "Failed to fetch ec2 uri #{uri}: #{e.message}") + return nil end private diff -Nru facter-2.3.0/lib/facter/ec2.rb facter-2.4.6/lib/facter/ec2.rb --- facter-2.3.0/lib/facter/ec2.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/ec2.rb 2016-01-26 18:41:33.000000000 +0000 @@ -15,7 +15,7 @@ # Directly queries the EC2 metadata endpoint. # -require 'facter/ec2/rest' +require 'facter/ec2/rest' unless defined?(Facter::EC2) Facter.define_fact(:ec2_metadata) do define_resolution(:rest) do diff -Nru facter-2.3.0/lib/facter/gid.rb facter-2.4.6/lib/facter/gid.rb --- facter-2.3.0/lib/facter/gid.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/gid.rb 2016-01-26 18:41:33.000000000 +0000 @@ -10,7 +10,7 @@ Facter.add(:gid) do confine do - Facter::Core::Execution.which('id') && Facter.value(:kernel) != "SunOS" + Facter::Core::Execution.which('id') && !["SunOS", "windows"].include?(Facter.value(:kernel)) end setcode { Facter::Core::Execution.exec('id -ng') } end diff -Nru facter-2.3.0/lib/facter/interfaces.rb facter-2.4.6/lib/facter/interfaces.rb --- facter-2.3.0/lib/facter/interfaces.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/interfaces.rb 2016-01-26 18:41:33.000000000 +0000 @@ -1,9 +1,16 @@ # Fact: interfaces # # Purpose: -# Generates the following facts on supported platforms: `_ipaddress`, -# `_ipaddress6`, `_macaddress`, `_netmask`, -# and `_mtu`. +# Returns a comma-separated list of the system's network interfaces. +# +# In addition to the main `interfaces` fact, this code will generate the +# following facts for each interface: +# +# * `ipaddress_` +# * `ipaddress6_` +# * `macaddress_` +# * `netmask_` +# * `mtu_` # # Resolution: # diff -Nru facter-2.3.0/lib/facter/ipaddress.rb facter-2.4.6/lib/facter/ipaddress.rb --- facter-2.3.0/lib/facter/ipaddress.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/ipaddress.rb 2016-01-26 18:41:33.000000000 +0000 @@ -49,7 +49,7 @@ ip = nil output = Facter::Util::IP.exec_ifconfig - output.split(/^\S/).each { |str| + output.split(/^\S/).each do |str| if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 unless tmp =~ /^127\./ @@ -57,7 +57,7 @@ break end end - } + end ip end @@ -69,7 +69,7 @@ ip = nil output = Facter::Util::IP.exec_ifconfig(["-a"]) - output.split(/^\S/).each { |str| + output.split(/^\S/).each do |str| if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ tmp = $1 unless tmp =~ /^127\./ or tmp == "0.0.0.0" @@ -77,7 +77,7 @@ break end end - } + end ip end @@ -87,17 +87,15 @@ confine :kernel => %w{AIX} setcode do ip = nil - output = Facter::Util::IP.exec_ifconfig(["-a"]) - output.split(/^\S/).each { |str| + default_interface = Facter::Util::IP.exec_netstat(["-rn | grep default | awk '{ print $6 }'"]) + output = Facter::Util::IP.exec_ifconfig([default_interface]) + + output.split(/^\S/).each do |str| if str =~ /inet ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/ - tmp = $1 - unless tmp =~ /^127\./ - ip = tmp - break - end + ip = $1 end - } + end ip end diff -Nru facter-2.3.0/lib/facter/ldom.rb facter-2.4.6/lib/facter/ldom.rb --- facter-2.3.0/lib/facter/ldom.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/ldom.rb 2016-01-26 18:41:33.000000000 +0000 @@ -47,15 +47,5 @@ end end end - - # When ldom domainrole control = false, the system is a guest, so we mark it - # as a virtual system: - Facter.add("virtual") do - confine :ldom_domainrole_control => 'false' - has_weight 10 - setcode do - Facter.value(:ldom_domainrole_impl) - end - end end end diff -Nru facter-2.3.0/lib/facter/macaddress.rb facter-2.4.6/lib/facter/macaddress.rb --- facter-2.3.0/lib/facter/macaddress.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/macaddress.rb 2016-01-26 18:41:33.000000000 +0000 @@ -72,7 +72,8 @@ setcode do ether = [] ip = nil - output = Facter::Util::IP.exec_ifconfig(["-a"]) + default_interface = Facter::Util::IP.exec_netstat(["-rn | grep default | awk '{ print $6 }'"]) + output = Facter::Util::IP.exec_ifconfig([default_interface]) output.each_line do |str| if str =~ /([a-z]+\d+): flags=/ devname = $1 diff -Nru facter-2.3.0/lib/facter/operatingsystem/implementation.rb facter-2.4.6/lib/facter/operatingsystem/implementation.rb --- facter-2.3.0/lib/facter/operatingsystem/implementation.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/operatingsystem/implementation.rb 2016-01-26 18:41:33.000000000 +0000 @@ -1,4 +1,5 @@ require 'facter/operatingsystem/base' +require 'facter/operatingsystem/osreleaselinux' require 'facter/operatingsystem/cumuluslinux' require 'facter/operatingsystem/linux' require 'facter/operatingsystem/sunos' @@ -13,6 +14,8 @@ release_info = Facter::Util::Operatingsystem.os_release if release_info['NAME'] == "Cumulus Linux" Facter::Operatingsystem::CumulusLinux.new + elsif release_info['NAME'] == "CoreOS" + Facter::Operatingsystem::OsReleaseLinux.new else Facter::Operatingsystem::Linux.new end diff -Nru facter-2.3.0/lib/facter/operatingsystem/osreleaselinux.rb facter-2.4.6/lib/facter/operatingsystem/osreleaselinux.rb --- facter-2.3.0/lib/facter/operatingsystem/osreleaselinux.rb 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/lib/facter/operatingsystem/osreleaselinux.rb 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,28 @@ +require 'facter/util/operatingsystem' +require 'facter/operatingsystem/linux' + +module Facter + module Operatingsystem + class OsReleaseLinux < Linux + def get_operatingsystem + # Native cfacter also uses the NAME field. + Facter::Util::Operatingsystem.os_release['NAME'] + end + + def get_osfamily + Facter::Util::Operatingsystem.os_release['NAME'] + end + + def get_operatingsystemrelease + @operatingsystemrelease ||= Facter::Util::Operatingsystem.os_release['VERSION_ID'] + @operatingsystemrelease + end + + def get_operatingsystemmajrelease + if operatingsystemrelease = get_operatingsystemrelease + operatingsystemrelease.split(".").first + end + end + end + end +end diff -Nru facter-2.3.0/lib/facter/operatingsystemmajrelease.rb facter-2.4.6/lib/facter/operatingsystemmajrelease.rb --- facter-2.3.0/lib/facter/operatingsystemmajrelease.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/operatingsystemmajrelease.rb 2016-01-26 18:41:33.000000000 +0000 @@ -3,11 +3,14 @@ # Purpose: Returns the major release of the operating system. # # Resolution: -# Uses the releasemajor key of the os structured fact, which itself -# splits down its operatingsystemrelease key at decimal point for -# osfamily RedHat derivatives and Debian. -# Uses operatingsystemrelease key to the first non decimal -# character for operatingsystem Solaris. +# Uses the release['major'] entry of the os structured fact, which itself +# attempts to use its own release['full'] entry to determine the major release value. +# In RedHat osfamily derivatives and Debian, splits down the release string for a decimal point +# and uses the first non-decimal character. +# In Solaris, uses the first non-decimal character of the release string. +# In Ubuntu, uses the characters before and after the first decimal point, as in '14.04'. +# In Windows, uses the full release string in the case of server releases, such as '2012 R2', +# and uses the first non-decimal character in the cases of releases such as '8.1'. # # This should be the same as lsbmajdistrelease, but on minimal systems there # are too many dependencies to use LSB @@ -16,7 +19,7 @@ # "Alpine" "Amazon" "Archlinux" "Ascendos" "Bluewhite64" "CentOS" "CloudLinux" # "Debian" "Fedora" "Gentoo" "Mandrake" "Mandriva" "MeeGo" "OEL" "OpenSuSE" # "OracleLinux" "OVS" "PSBM" "RedHat" "Scientific" "Slackware" "Slamd64" "SLC" -# "SLED" "SLES" "SuSE" "Ubuntu" "VMWareESX" +# "SLED" "SLES" "Solaris" "SuSE" "Ubuntu" "VMWareESX" # Facter.add(:operatingsystemmajrelease) do diff -Nru facter-2.3.0/lib/facter/os.rb facter-2.4.6/lib/facter/os.rb --- facter-2.3.0/lib/facter/os.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/os.rb 2016-01-26 18:41:33.000000000 +0000 @@ -1,29 +1,58 @@ # Fact: os # # Purpose: -# Return various facts related to the machine's operating system. +# Return various facts related to the machine's operating system, including: +# Name: The name of the operating system. +# Family: A mapping of the operating system to an operating system family. +# Release: The release version of the operating system. Includes entries for the +# major and minor release versions, as well as the full release string. +# Lsb: Linux Standard Base information for the system. +# +# This fact is structured. These values are returned as a group of key-value pairs. # # Resolution: -# For operatingsystem, if the kernel is a Linux kernel, check for the -# existence of a selection of files in `/etc` to find the specific flavor. +# For the name entry, if the kernel is a Linux kernel, check for the existence of a +# selection of files in `/etc` to find the specific flavor. # On SunOS based kernels, attempt to determine the flavor, otherwise return Solaris. # On systems other than Linux, use the kernel value. # -# For operatingsystemrelease, on RedHat derivatives, we return their `/etc/-release` file. +# For the family entry, map operating systems to operating system families, such +# as linux distribution derivatives. Adds mappings from specific operating systems +# to kernels in the case that it is relevant. +# +# For the release entry, on RedHat derivatives, returns `/etc/-release` file. # On Debian, returns `/etc/debian_version`. # On Ubuntu, parses `/etc/lsb-release` for the release version -# On Suse and derivatives, parses `/etc/SuSE-release` for a selection of version information. +# On Suse and derivatives, parses `/etc/SuSE-release` for a selection of version +# information. # On Slackware, parses `/etc/slackware-version`. # On Amazon Linux, returns the lsbdistrelease fact's value. # On Mageia, parses `/etc/mageia-release` for the release version. # On all remaining systems, returns the kernelrelease fact's value. # -# For the lsb facts, uses the `lsb_release` system command. +# For the major version, uses the value of the full release string to determine the major +# release version. +# In RedHat osfamily derivatives and Debian, splits down the release string for a decimal point +# and uses the first non-decimal character. +# In Solaris, uses the first non-decimal character of the release string. +# In Ubuntu, uses the characters before and after the first decimal point, as in '14.04'. +# In Windows, uses the full release string in the case of server releases, such as '2012 R2', +# and uses the first non-decimal character in the cases of releases such as '8.1'. +# +# For the minor version, attempts to split the full release version string and return +# the value of the character after the first decimal. +# +# For the lsb entries, uses the `lsb_release` system command. # # Caveats: -# Lsb facts only work on Linux (and the kfreebsd derivative) systems. -# Requires the `lsb_release` program, which may not be installed by default. -# It is only as accurate as the ourput of lsb_release. +# The family entry is completely reliant on the name key, and no heuristics are used. +# +# The major and minor release sub-facts of the release entry are not currenty +# supported on all platforms. +# +# The lsb entries only work on Linux (and the kfreebsd derivative) systems. Requires +# the `lsb_release` program, which may not be installed by default. It is only as +# accurate as the output of `lsb_release`. # require 'facter/operatingsystem/implementation' diff -Nru facter-2.3.0/lib/facter/partitions.rb facter-2.4.6/lib/facter/partitions.rb --- facter-2.3.0/lib/facter/partitions.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/partitions.rb 2016-01-26 18:41:33.000000000 +0000 @@ -3,6 +3,8 @@ # Purpose: # Return the details of the disk partitions. # +# This fact is structured. Values are returned as a group of key-value pairs. +# # Resolution: # Parse the contents of `/sys/block//size` to receive the size (multiplying by 512 to correct for blocks-to-bytes). # @@ -27,6 +29,7 @@ details['uuid'] = Facter::Util::Partitions.uuid(part) details['size'] = Facter::Util::Partitions.size(part) details['mount'] = Facter::Util::Partitions.mount(part) + details['label'] = Facter::Util::Partitions.label(part) details['filesystem'] = Facter::Util::Partitions.filesystem(part) details.reject! {|k,v| v.nil? || v.to_s.empty? } partitions[part] = details diff -Nru facter-2.3.0/lib/facter/processors/os.rb facter-2.4.6/lib/facter/processors/os.rb --- facter-2.3.0/lib/facter/processors/os.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/processors/os.rb 2016-01-26 18:41:33.000000000 +0000 @@ -112,7 +112,7 @@ # get each physical processor Facter::Util::WMI.execquery("select * from Win32_Processor").each do |proc| # not supported before 2008 - if proc.respond_to?(:NumberOfLogicalProcessors) + if proc.ole_respond_to?(:NumberOfLogicalProcessors) processor_num = proc.NumberOfLogicalProcessors else processor_num = 1 diff -Nru facter-2.3.0/lib/facter/processors.rb facter-2.4.6/lib/facter/processors.rb --- facter-2.3.0/lib/facter/processors.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/processors.rb 2016-01-26 18:41:33.000000000 +0000 @@ -1,18 +1,24 @@ # Fact: processors # # Purpose: -# Additional facts about the machine's CPU's, including -# processor lists, models, counts, and speeds. +# Provide additional facts about the machine's CPUs, including: +# Models: A list of processors present on the system. +# Count: The number of hardware threads. +# Physicalcount: The number of physical processors. +# Speed: The speed of the processors on the system. +# +# This fact is structured. These values are returned as a group of key-value pairs. # # Resolution: -# Each kernel utilizes its own implementation object to collect -# processor data. Linux and kFreeBSD parse `/proc/cpuinfo` for each -# processor. AIX parses the output of `lsdev` for its processor section. -# For Solaris, we parse the output of `kstat` for each processor. OpenBSD uses -# the sysctl variables 'hw.model' and 'hw.ncpu' for the CPU model and -# the CPU count respectively. Darwin utilizes the system profiler to collect -# the physical CPU count and speed. +# Linux and kFreeBSD parse `/proc/cpuinfo` for each processor. +# AIX parses the output of `lsdev` for its processor section. +# Solaris parses the output of `kstat` for each processor. +# OpenBSD uses the sysctl variables `hw.model` and `hw.ncpu` for the CPU model +# and the CPU count respectively. +# Darwin utilizes the system profiler to collect the physical CPU count and speed. # +# Caveats: +# The 'speed' sub-fact is not currently supported on all platforms. require 'facter/processors/os' diff -Nru facter-2.3.0/lib/facter/puppetversion.rb facter-2.4.6/lib/facter/puppetversion.rb --- facter-2.3.0/lib/facter/puppetversion.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/puppetversion.rb 2016-01-26 18:41:33.000000000 +0000 @@ -11,8 +11,8 @@ Facter.add(:puppetversion) do setcode do begin - require 'puppet' - Puppet::PUPPETVERSION.to_s + require 'puppet/version' + Puppet.version.to_s rescue LoadError nil end diff -Nru facter-2.3.0/lib/facter/selinux.rb facter-2.4.6/lib/facter/selinux.rb --- facter-2.3.0/lib/facter/selinux.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/selinux.rb 2016-01-26 18:41:33.000000000 +0000 @@ -148,7 +148,7 @@ setcode do result = 'unknown' mode = Facter::Core::Execution.exec(sestatus_cmd) - mode.each_line { |l| result = $1 if l =~ /^Policy from config file\:\s+(\w+)$/i } + mode.each_line { |l| result = $2 if l =~ /^(Policy from config file|Loaded policy name)\:\s+(\w+)$/i } result.chomp end end diff -Nru facter-2.3.0/lib/facter/system32.rb facter-2.4.6/lib/facter/system32.rb --- facter-2.3.0/lib/facter/system32.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/system32.rb 2016-01-26 18:41:33.000000000 +0000 @@ -12,7 +12,7 @@ Facter.add(:system32) do confine :kernel => :windows setcode do - if File.exists?("#{ENV['SYSTEMROOT']}\\sysnative") + if File.exist?("#{ENV['SYSTEMROOT']}\\sysnative") "#{ENV['SYSTEMROOT']}\\sysnative" else "#{ENV['SYSTEMROOT']}\\system32" diff -Nru facter-2.3.0/lib/facter/system_uptime.rb facter-2.4.6/lib/facter/system_uptime.rb --- facter-2.3.0/lib/facter/system_uptime.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/system_uptime.rb 2016-01-26 18:41:33.000000000 +0000 @@ -5,6 +5,8 @@ # seconds, hours, days and a general, human # readable uptime. # +# This fact is structured. These values are returned as a group of key-value pairs. +# # Resolution: # Does basic math on the get_uptime_seconds utility # to calculate seconds, hours and days. diff -Nru facter-2.3.0/lib/facter/util/config.rb facter-2.4.6/lib/facter/util/config.rb --- facter-2.3.0/lib/facter/util/config.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/config.rb 2016-01-26 18:41:33.000000000 +0000 @@ -41,12 +41,19 @@ if Facter::Util::Root.root? windows_dir = windows_data_dir if windows_dir.nil? then - @external_facts_dirs = ["/etc/facter/facts.d", "/etc/puppetlabs/facter/facts.d"] + # Note: Beginning with Facter 3, /opt/puppetlabs/facter/facts.d will be the only + # default external fact directory. + @external_facts_dirs = ["/opt/puppetlabs/facter/facts.d", + "/etc/facter/facts.d", + "/etc/puppetlabs/facter/facts.d"] else @external_facts_dirs = [File.join(windows_dir, 'PuppetLabs', 'facter', 'facts.d')] end elsif ENV['HOME'] - @external_facts_dirs = [File.expand_path(File.join(ENV['HOME'], ".facter", "facts.d"))] + # Note: Beginning with Facter 3, ~/.puppetlabs/opt/facter/facts.d will be the only + # default external fact directory. + @external_facts_dirs = [File.expand_path(File.join(ENV['HOME'], ".puppetlabs", "opt", "facter", "facts.d")), + File.expand_path(File.join(ENV['HOME'], ".facter", "facts.d"))] else @external_facts_dirs = [] end @@ -60,4 +67,22 @@ end setup_default_ext_facts_dirs + + def self.override_binary_dir=(dir) + @override_binary_dir = dir + end + + def self.override_binary_dir + @override_binary_dir + end + + def self.setup_default_override_binary_dir + if Facter::Util::Config.is_windows? + @override_binary_dir = nil + else + @override_binary_dir = "/opt/puppetlabs/puppet/bin" + end + end + + setup_default_override_binary_dir end diff -Nru facter-2.3.0/lib/facter/util/dhcp_servers.rb facter-2.4.6/lib/facter/util/dhcp_servers.rb --- facter-2.3.0/lib/facter/util/dhcp_servers.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/dhcp_servers.rb 2016-01-26 18:41:33.000000000 +0000 @@ -25,9 +25,8 @@ def self.device_dhcp_server(device) if Facter::Core::Execution.which('nmcli') - version = self.nmcli_version # If the version is >= 0.9.9, use show instead of list - if version && version[0] > 0 || version[1] > 9 || (version[1] == 9 && version[2] >= 9) + if is_newer_nmcli? Facter::Core::Execution.exec("nmcli -f all d show #{device}").scan(/dhcp_server_identifier.*?(\d+\.\d+\.\d+\.\d+)$/).flatten.first else Facter::Core::Execution.exec("nmcli -f all d list iface #{device}").scan(/dhcp_server_identifier.*?(\d+\.\d+\.\d+\.\d+)$/).flatten.first @@ -35,9 +34,25 @@ end end + def self.network_manager_state + # If the version is >= 0.9.9, use g instead of nm + if is_newer_nmcli? + output = Facter::Core::Execution.exec('nmcli -t -f STATE g 2>/dev/null') + else + output = Facter::Core::Execution.exec('nmcli -t -f STATE nm 2>/dev/null') + end + return nil unless output + output.strip + end + def self.nmcli_version if version = Facter::Core::Execution.exec("nmcli --version") version.scan(/version\s(\d+)\.?(\d+)?\.?(\d+)?\.?(\d+)?/).flatten.map(&:to_i) end end + + def self.is_newer_nmcli? + version = nmcli_version + version && (version[0] > 0 || version[1] > 9 || (version[1] == 9 && version[2] >= 9)) + end end diff -Nru facter-2.3.0/lib/facter/util/directory_loader.rb facter-2.4.6/lib/facter/util/directory_loader.rb --- facter-2.3.0/lib/facter/util/directory_loader.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/directory_loader.rb 2016-01-26 18:41:33.000000000 +0000 @@ -1,7 +1,10 @@ # A Facter plugin that loads external facts. # # Default Unix Directories: -# /etc/facter/facts.d", "/etc/puppetlabs/facter/facts.d" +# /opt/puppetlabs/facter/facts.d, /etc/facter/facts.d, /etc/puppetlabs/facter/facts.d +# +# Beginning with Facter 3, only /opt/puppetlabs/facter/facts.d will be a default external fact +# directory in Unix. # # Default Windows Direcotires: # C:\ProgramData\Puppetlabs\facter\facts.d (2008) @@ -30,8 +33,9 @@ # Directory for fact loading attr_reader :directory - def initialize(dir) + def initialize(dir, weight = nil) @directory = dir + @weight = weight || EXTERNAL_FACT_WEIGHT end def self.loader_for(dir) @@ -52,6 +56,7 @@ # Load facts from files in fact directory using the relevant parser classes to # parse them. def load(collection) + weight = @weight entries.each do |file| parser = Facter::Util::Parser.parser_for(file) if parser == nil @@ -64,7 +69,7 @@ elsif data == {} or data == nil Facter.warn "Fact file #{file} was parsed but returned an empty data set" else - data.each { |p,v| collection.add(p, :value => v) { has_weight(EXTERNAL_FACT_WEIGHT) } } + data.each { |p,v| collection.add(p, :value => v) { has_weight(weight) } } end end end diff -Nru facter-2.3.0/lib/facter/util/ip/windows.rb facter-2.4.6/lib/facter/util/ip/windows.rb --- facter-2.3.0/lib/facter/util/ip/windows.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/ip/windows.rb 2016-01-26 18:41:33.000000000 +0000 @@ -43,8 +43,8 @@ interface_names = [] network_adapter_configurations.map do |nic| - Facter::Util::WMI.execquery("SELECT * FROM Win32_NetworkAdapter WHERE Index = #{nic.Index} AND NetEnabled = TRUE").each do |nic| - interface_names << nic.NetConnectionId unless nic.NetConnectionId.nil? or nic.NetConnectionId.empty? + Facter::Util::WMI.execquery("SELECT * FROM Win32_NetworkAdapter WHERE Index = #{nic.Index} AND NetEnabled = TRUE").each do |sub_nic| + interface_names << sub_nic.NetConnectionId unless sub_nic.NetConnectionId.nil? or sub_nic.NetConnectionId.empty? end end diff -Nru facter-2.3.0/lib/facter/util/ip.rb facter-2.4.6/lib/facter/util/ip.rb --- facter-2.3.0/lib/facter/util/ip.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/ip.rb 2016-01-26 18:41:33.000000000 +0000 @@ -31,6 +31,13 @@ :macaddress => /(\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2})/, :netmask => /.*\s+netmask (\S+)\s.*/ }, + :aix => { + :ipaddress => /inet\s+([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/, + :ipaddress6 => /inet6 ((?![fe80|::1])(?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/, + :netmask => /netmask\s+0x(\w{8})/, + :mtu => /mtu\s+(\d+)/, + :macaddress => /^Hardware\sAddress:\s(\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2})/ + }, :windows => {} } @@ -40,7 +47,7 @@ end def self.convert_from_hex?(kernel) - kernels_to_convert = [:sunos, :openbsd, :netbsd, :freebsd, :darwin, :"hp-ux", :"gnu/kfreebsd", :dragonfly] + kernels_to_convert = [:sunos, :openbsd, :netbsd, :freebsd, :darwin, :"hp-ux", :"gnu/kfreebsd", :dragonfly, :aix] kernels_to_convert.include?(kernel) end @@ -73,7 +80,7 @@ def self.get_all_interface_output case Facter.value(:kernel) - when 'Linux', 'OpenBSD', 'NetBSD', 'FreeBSD', 'Darwin', 'GNU/kFreeBSD', 'DragonFly' + when 'Linux', 'OpenBSD', 'NetBSD', 'FreeBSD', 'Darwin', 'GNU/kFreeBSD', 'DragonFly', 'AIX' output = Facter::Util::IP.exec_ifconfig(["-a","2>/dev/null"]) when 'SunOS' output = Facter::Util::IP.exec_ifconfig(["-a"]) @@ -106,6 +113,23 @@ common_paths=["/bin/ifconfig","/sbin/ifconfig","/usr/sbin/ifconfig"] common_paths.select{|path| File.executable?(path)}.first end + + ## + # exec_netstat uses the netstat command + # + # @return [String] the output of `netstat #{arguments} 2>/dev/null` or nil + def self.exec_netstat(additional_arguments=[]) + Facter::Core::Execution.exec("#{self.get_netstat} #{additional_arguments.join(' ')}") + end + ## + # get_netstat looks up the netstat binary + # + # @return [String] path to the netstat binary + def self.get_netstat + common_paths=["/bin/netstat","/sbin/netstat","/usr/sbin/netstat","/usr/bin/netstat"] + common_paths.select{|path| File.executable?(path)}.first + end + ## # hpux_netstat_in is a delegate method that allows us to stub netstat -in # without stubbing exec. @@ -117,7 +141,7 @@ if File.exists?("/sys/class/net/#{interface}/address") then ib_mac_address = `cat /sys/class/net/#{interface}/address`.chomp elsif File.exists?("/sbin/ip") then - ip_output = %x{/sbin/ip link show #{interface}} + ip_output = %x{/sbin/ip link show '#{interface}'} ib_mac_address = ip_output.scan(%r{infiniband\s+((\w{1,2}:){5,}\w{1,2})}) else ib_mac_address = "FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF" @@ -127,7 +151,7 @@ end def self.ifconfig_interface(interface) - output = Facter::Util::IP.exec_ifconfig([interface,"2>/dev/null"]) + output = Facter::Util::IP.exec_ifconfig(["'#{interface}'","2>/dev/null"]) end def self.get_single_interface_output(interface) @@ -151,6 +175,9 @@ hpux_lanscan.scan(/(\dx\S+).*UP\s+(\w+\d+)/).each {|i| mac = i[0] if i.include?(interface) } mac = mac.sub(/0x(\S+)/,'\1').scan(/../).join(":") output = ifc + "\n" + mac + when 'AIX' + output = Facter::Util::IP.ifconfig_interface(interface) + "\n" + aix_get_mtu(interface) + "\n" + aix_get_macadress(interface) + output end output end @@ -163,6 +190,34 @@ Facter::Core::Execution.exec("/usr/sbin/lanscan") end + def self.aix_lsattr_interface(interface) + Facter::Core::Execution.exec("/usr/sbin/lsattr -El #{interface}") + end + + def self.aix_entstat_interface(interface) + if interface[0..1] != "lo" + Facter::Core::Execution.exec("/usr/bin/entstat #{interface}") + else + return "" + end + end + + def self.aix_get_mtu(interface) + aix_lsattr_interface(interface).each_line do |s| + if s =~ /mtu\s+(\d+)/ + return s + end + end + end + + def self.aix_get_macadress(interface) + aix_entstat_interface(interface).each_line do |s| + if s =~ /^Hardware\sAddress:\s(\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2}:\w{1,2})/ + return s + end + end + end + def self.get_output_for_interface_and_label(interface, label) return get_single_interface_output(interface) unless Facter.value(:kernel) == 'windows' @@ -188,7 +243,7 @@ return nil end regex = /SLAVE[,>].* (bond[0-9]+)/ - ethbond = regex.match(%x{/sbin/ip link show #{interface}}) + ethbond = regex.match(%x{/sbin/ip link show '#{interface}'}) if ethbond device = ethbond[1] else @@ -231,8 +286,8 @@ # Linux changes the MAC address reported via ifconfig when an ethernet interface # becomes a slave of a bonding device to the master MAC address. # We have to dig a bit to get the original/real MAC address of the interface. - bonddev = get_bonding_master(interface) - if label == 'macaddress' and bonddev + bonddev = get_bonding_master(interface) if label == 'macaddress' + if bonddev bondinfo = read_proc_net_bonding("/proc/net/bonding/#{bonddev}") re = /^Slave Interface: #{interface}\b.*?\bPermanent HW addr: (([0-9A-F]{2}:?)*)$/im if match = re.match(bondinfo) diff -Nru facter-2.3.0/lib/facter/util/partitions/linux.rb facter-2.4.6/lib/facter/util/partitions/linux.rb --- facter-2.3.0/lib/facter/util/partitions/linux.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/partitions/linux.rb 2016-01-26 18:41:33.000000000 +0000 @@ -55,6 +55,12 @@ end end + def self.label(partition) + if Facter::Core::Execution.which('blkid') + Facter::Core::Execution.exec("blkid #{File.join('/dev', partition)}").scan(/LABEL="([^"]*)"/).flatten.first + end + end + private def self.read_size(partition) if device = partition.match(/(\D+)/)[1] and File.readable?(File.join(SYSFS_BLOCK_DIRECTORY, device, partition, 'size')) diff -Nru facter-2.3.0/lib/facter/util/partitions/openbsd.rb facter-2.4.6/lib/facter/util/partitions/openbsd.rb --- facter-2.3.0/lib/facter/util/partitions/openbsd.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/partitions/openbsd.rb 2016-01-26 18:41:33.000000000 +0000 @@ -22,6 +22,11 @@ def self.filesystem(partition) scan_mount(/\/dev\/#{partition}\son\s\S+\stype\s(\S+)/) end + + # On OpenBSD there are no labels for partitions + def self.label(partition) + nil + end private def self.scan_mount(scan_regex) diff -Nru facter-2.3.0/lib/facter/util/partitions.rb facter-2.4.6/lib/facter/util/partitions.rb --- facter-2.3.0/lib/facter/util/partitions.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/partitions.rb 2016-01-26 18:41:33.000000000 +0000 @@ -37,6 +37,10 @@ implementation.filesystem(partition) end + def self.label(partition) + implementation.label(partition) + end + def self.available? !self.list.empty? end diff -Nru facter-2.3.0/lib/facter/util/processor.rb facter-2.4.6/lib/facter/util/processor.rb --- facter-2.3.0/lib/facter/util/processor.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/processor.rb 2016-01-26 18:41:33.000000000 +0000 @@ -232,7 +232,7 @@ end end - when "ppc64" + when "ppc64", "ppc64le" File.readlines(cpuinfo).each do |l| if l =~ /processor\s+:\s+(\d+)/ processor_num = $1.to_i diff -Nru facter-2.3.0/lib/facter/util/resolution.rb facter-2.4.6/lib/facter/util/resolution.rb --- facter-2.3.0/lib/facter/util/resolution.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/resolution.rb 2016-01-26 18:41:33.000000000 +0000 @@ -25,7 +25,7 @@ class << self # Expose command execution methods that were extracted into - # Facter::Util::Execution from Facter::Util::Resolution in Facter 2.0.0 for + # Facter::Core::Execution from Facter::Util::Resolution in Facter 2.0.0 for # compatibility. # # @deprecated diff -Nru facter-2.3.0/lib/facter/util/uptime.rb facter-2.4.6/lib/facter/util/uptime.rb --- facter-2.3.0/lib/facter/util/uptime.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/uptime.rb 2016-01-26 18:41:33.000000000 +0000 @@ -40,7 +40,7 @@ if output up=0 - if output =~ /(\d+) day(?:s|\(s\))?,\s+(\d+):(\d+)/ + if output =~ /(\d+) day(?:s|\(s\))?,?\s+(\d+):-?(\d+)/ # Regexp handles Solaris, AIX, HP-UX, and Tru64. # 'day(?:s|\(s\))?' says maybe 'day', 'days', # or 'day(s)', and don't set $2. @@ -51,9 +51,10 @@ up=86400*$1.to_i + 60*$2.to_i elsif output =~ /(\d+) day(?:s|\(s\))?,/ up=86400*$1.to_i - elsif output =~ /up\s+(\d+):(\d+),/ + elsif output =~ /up\s+(\d+):-?(\d+),/ # must anchor to 'up' to avoid matching time of day - # at beginning of line. + # at beginning of line. Certain versions of uptime on + # Solaris may insert a '-' into the minutes field. up=3600*$1.to_i + 60*$2.to_i elsif output =~ /(\d+) hr(?:s|\(s\))?,/ up=3600*$1.to_i @@ -77,6 +78,6 @@ end def self.uptime_executable_cmd - "/usr/bin/uptime" + "uptime" end end diff -Nru facter-2.3.0/lib/facter/util/virtual.rb facter-2.4.6/lib/facter/util/virtual.rb --- facter-2.3.0/lib/facter/util/virtual.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/virtual.rb 2016-01-26 18:41:33.000000000 +0000 @@ -13,9 +13,17 @@ # and later versions of virt-what may emit this message on stderr. This # method ensures stderr is redirected and that error messages are stripped # from stdout. - def self.virt_what(command = "virt-what") - command = Facter::Core::Execution.which(command) - return unless command + def self.virt_what(cmd = "virt-what") + if bindir = Facter::Util::Config.override_binary_dir + command = Facter::Core::Execution.which(File.join(bindir, cmd)) + else + command = nil + end + + if !command + command = Facter::Core::Execution.which(cmd) + return unless command + end if Facter.value(:kernel) == 'windows' redirected_cmd = "#{command} 2>NUL" @@ -153,7 +161,13 @@ def self.lxc? path = Pathname.new('/proc/1/cgroup') return false unless path.readable? - in_lxc = path.readlines.any? {|l| l.split(":")[2].to_s.start_with? '/lxc/' } + begin + in_lxc = path.readlines.any? {|l| l.split(":")[2].to_s.include? '/lxc' } + rescue Errno::EPERM => exc + # If we get "operation not permitted" here, it probably means we are + # running OpenVZ. We are not running LXC anyway, so... + return false + end return true if in_lxc return false end @@ -164,7 +178,12 @@ def self.docker? path = Pathname.new('/proc/1/cgroup') return false unless path.readable? - in_docker = path.readlines.any? {|l| l.split(":")[2].to_s.start_with? '/docker/' } + begin + in_docker = path.readlines.any? {|l| l.split(":")[2].to_s.include? '/docker' } + rescue Errno::EPERM => exc + # This can fail under OpenVZ, just like in .lxc? + return false + end return true if in_docker return false end diff -Nru facter-2.3.0/lib/facter/util/xendomains.rb facter-2.4.6/lib/facter/util/xendomains.rb --- facter-2.3.0/lib/facter/util/xendomains.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/util/xendomains.rb 2016-01-26 18:41:33.000000000 +0000 @@ -4,7 +4,16 @@ XEN_COMMANDS = ['/usr/sbin/xl', '/usr/sbin/xm'] def self.xen_command - XEN_COMMANDS.find { |cmd| Facter::Util::Resolution.which(cmd) } + if File.file?('/usr/lib/xen-common/bin/xen-toolstack') + xen_toolstack_cmd = Facter::Util::Resolution.exec('/usr/lib/xen-common/bin/xen-toolstack') + if xen_toolstack_cmd + xen_toolstack_cmd.chomp + else + nil + end + else + XEN_COMMANDS.find { |cmd| Facter::Util::Resolution.which(cmd) } + end end def self.get_domains diff -Nru facter-2.3.0/lib/facter/version.rb facter-2.4.6/lib/facter/version.rb --- facter-2.3.0/lib/facter/version.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/version.rb 2016-01-26 18:41:33.000000000 +0000 @@ -1,6 +1,6 @@ module Facter if not defined? FACTERVERSION then - FACTERVERSION = '2.3.0' + FACTERVERSION = '2.4.6' end # Returns the running version of Facter. diff -Nru facter-2.3.0/lib/facter/virtual.rb facter-2.4.6/lib/facter/virtual.rb --- facter-2.3.0/lib/facter/virtual.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/lib/facter/virtual.rb 2016-01-26 18:41:33.000000000 +0000 @@ -73,7 +73,7 @@ Facter.add("virtual") do confine :kernel => 'SunOS' has_weight 10 - self.timeout = 6 + self.timeout = 20 setcode do next "zone" if Facter::Util::Virtual.zone? @@ -90,6 +90,17 @@ end Facter.add("virtual") do + confine :kernel => 'SunOS' + confine :hardwareisa => 'sparc' + confine :ldom_domainrole_control => 'false' + has_weight 20 # Weight this before the default solaris implementation + setcode do + Facter.value(:ldom_domainrole_impl) + end +end + + +Facter.add("virtual") do confine :kernel => 'HP-UX' has_weight 10 setcode do @@ -131,7 +142,7 @@ if Facter::Util::Virtual.xen? next "xen0" if FileTest.exists?("/dev/xen/evtchn") - next "xenu" if FileTest.exists?("/proc/xen") + next "xenu" if FileTest.exists?("/proc/xen") || FileTest.exists?("/dev/xvda1") end next "virtualbox" if Facter::Util::Virtual.virtualbox? @@ -149,7 +160,7 @@ next "xenhvm" if lines.any? {|l| l =~ /XenSource/ } next "hyperv" if lines.any? {|l| l =~ /Microsoft Corporation Hyper-V/ } next "gce" if lines.any? {|l| l =~ /Class 8007: Google, Inc/ } - next "kvm" if lines.any? {|l| l =~ /virtio/ } + next "kvm" if lines.any? {|l| l =~ /virtio/i } end # Parse dmidecode @@ -164,6 +175,7 @@ next "rhev" if lines.any? {|l| l =~ /Product Name: RHEV Hypervisor/ } next "ovirt" if lines.any? {|l| l =~ /Product Name: oVirt Node/ } next "bochs" if lines.any? {|l| l =~ /Bochs/ } + next "kvm" if lines.any? {|l| l =~ /Manufacturer: QEMU/ } end # Default to 'physical' diff -Nru facter-2.3.0/spec/fixtures/cpuinfo/ppc64le facter-2.4.6/spec/fixtures/cpuinfo/ppc64le --- facter-2.3.0/spec/fixtures/cpuinfo/ppc64le 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/spec/fixtures/cpuinfo/ppc64le 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,15 @@ +processor : 0 +cpu : POWER8E (raw), altivec supported +clock : 3690.000000MHz +revision : 2.1 (pvr 004b 0201) + +processor : 1 +cpu : POWER8E (raw), altivec supported +clock : 3690.000000MHz +revision : 2.1 (pvr 004b 0201) + +timebase : 512000000 +platform : PowerNV +model : 8247-22L +machine : PowerNV 8247-22L +firmware : OPAL v3 diff -Nru facter-2.3.0/spec/fixtures/unit/selinux/selinux_sestatus2 facter-2.4.6/spec/fixtures/unit/selinux/selinux_sestatus2 --- facter-2.3.0/spec/fixtures/unit/selinux/selinux_sestatus2 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/spec/fixtures/unit/selinux/selinux_sestatus2 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,9 @@ +SELinux status: enabled +SELinuxfs mount: /sys/fs/selinux +SELinux root directory: /etc/selinux +Loaded policy name: default +Current mode: enforcing +Mode from config file: permissive +Policy MLS status: enabled +Policy deny_unknown status: denied +Max kernel policy version: 29 diff -Nru facter-2.3.0/spec/fixtures/unit/util/operatingsystem/coreos.txt facter-2.4.6/spec/fixtures/unit/util/operatingsystem/coreos.txt --- facter-2.3.0/spec/fixtures/unit/util/operatingsystem/coreos.txt 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/spec/fixtures/unit/util/operatingsystem/coreos.txt 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,9 @@ +NAME=CoreOS +ID=coreos +VERSION=575.0.0 +VERSION_ID=575.0.0 +BUILD_ID= +PRETTY_NAME="CoreOS 575.0.0" +ANSI_COLOR="1;32" +HOME_URL="https://coreos.com/" +BUG_REPORT_URL="https://github.com/coreos/bugs/issues" diff -Nru facter-2.3.0/spec/fixtures/virtual/proc_1_cgroup/in_a_docker_container_with_systemd_slices facter-2.4.6/spec/fixtures/virtual/proc_1_cgroup/in_a_docker_container_with_systemd_slices --- facter-2.3.0/spec/fixtures/virtual/proc_1_cgroup/in_a_docker_container_with_systemd_slices 1970-01-01 00:00:00.000000000 +0000 +++ facter-2.4.6/spec/fixtures/virtual/proc_1_cgroup/in_a_docker_container_with_systemd_slices 2016-01-26 18:41:33.000000000 +0000 @@ -0,0 +1,10 @@ +10:hugetlb:/ +9:perf_event:/ +8:blkio:/system.slice/docker-8255e18aa44c5809a33db5f324a4b34e3a73b246394e4070cff752cd84d79a6d.scope +7:net_cls:/ +6:freezer:/system.slice/docker-8255e18aa44c5809a33db5f324a4b34e3a73b246394e4070cff752cd84d79a6d.scope +5:devices:/system.slice/docker-8255e18aa44c5809a33db5f324a4b34e3a73b246394e4070cff752cd84d79a6d.scope +4:memory:/system.slice/docker-8255e18aa44c5809a33db5f324a4b34e3a73b246394e4070cff752cd84d79a6d.scope +3:cpuacct,cpu:/system.slice/docker-8255e18aa44c5809a33db5f324a4b34e3a73b246394e4070cff752cd84d79a6d.scope +2:cpuset:/system.slice/docker-8255e18aa44c5809a33db5f324a4b34e3a73b246394e4070cff752cd84d79a6d.scope +1:name=systemd:/system.slice/docker-8255e18aa44c5809a33db5f324a4b34e3a73b246394e4070cff752cd84d79a6d.scope diff -Nru facter-2.3.0/spec/unit/application_spec.rb facter-2.4.6/spec/unit/application_spec.rb --- facter-2.3.0/spec/unit/application_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/application_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -54,6 +54,15 @@ end end + ['-h', '--help'].each do |option| + it "issues a deprecation message for `--puppet`" do + Facter::Application.stubs(:exit).with(0) + expect do + Facter::Application.parse([option]) + end.to have_printed('Deprecated: use `puppet facts` instead') + end + end + it 'mutates argv so that non-option arguments are left' do argv = ['-y', '--trace', 'uptime', 'virtual'] Facter::Application.parse(argv) diff -Nru facter-2.3.0/spec/unit/core/execution/posix_spec.rb facter-2.4.6/spec/unit/core/execution/posix_spec.rb --- facter-2.3.0/spec/unit/core/execution/posix_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/core/execution/posix_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -16,6 +16,7 @@ context "and provided with an absolute path" do it "should return the binary if executable" do + File.expects(:file?).with('/opt/foo').returns true File.expects(:executable?).with('/opt/foo').returns true subject.which('/opt/foo').should == '/opt/foo' end @@ -24,12 +25,21 @@ File.expects(:executable?).with('/opt/foo').returns false subject.which('/opt/foo').should be_nil end + + it "should return nil if the binary is not a file" do + File.expects(:file?).with('/opt/foo').returns false + File.expects(:executable?).with('/opt/foo').returns true + subject.which('/opt/foo').should be_nil + end end context "and not provided with an absolute path" do it "should return the absolute path if found" do + File.expects(:file?).with('/bin/foo').never File.expects(:executable?).with('/bin/foo').returns false + File.expects(:file?).with('/sbin/foo').returns true File.expects(:executable?).with('/sbin/foo').returns true + File.expects(:file?).with('/usr/sbin/foo').never File.expects(:executable?).with('/usr/sbin/foo').never subject.which('foo').should == '/sbin/foo' end diff -Nru facter-2.3.0/spec/unit/core/logging_spec.rb facter-2.4.6/spec/unit/core/logging_spec.rb --- facter-2.3.0/spec/unit/core/logging_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/core/logging_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -8,6 +8,7 @@ after(:all) do subject.debugging(false) subject.timing(false) + subject.on_message end describe "emitting debug messages" do @@ -101,4 +102,122 @@ expect(subject.timing?).to be_false end end + + describe 'without a logging callback' do + before :each do + subject.timing(true) + subject.debugging(true) + subject.on_message + end + + it 'calls puts for debug' do + subject.expects(:puts).with(subject::GREEN + 'foo' + subject::RESET).once + subject.debug('foo') + end + + it 'calls puts for debugonce' do + subject.expects(:puts).with(subject::GREEN + 'foo' + subject::RESET).once + subject.debugonce('foo') + subject.debugonce('foo') + end + + it 'calls Kernel.warn for warn' do + Kernel.expects(:warn).with('foo').once + subject.warn('foo') + end + + it 'calls Kernel.warn for warnonce' do + Kernel.expects(:warn).with('foo').once + subject.warnonce('foo') + subject.warnonce('foo') + end + + it 'calls $stderr.puts for timing' do + $stderr.expects(:puts).with(subject::GREEN + 'foo' + subject::RESET).once + subject.show_time('foo') + end + end + + describe 'with a logging callback' do + before :each do + subject.debugging(true) + subject.timing(true) + subject.on_message + end + + def log_message(level, message) + called = false + subject.on_message do |lvl, msg| + called = true + expect(lvl).to eq(level) + expect(msg).to eq(message) + end + case level + when :debug + Facter.debug(message) + when :warn + Facter.warn(message) + when :info + Facter.show_time(message) + else + raise 'unexpected logging level' + end + subject.on_message + expect(called).to be_true + end + + def log_message_once(level, message) + calls = 0 + subject.on_message do |lvl, msg| + expect(lvl).to eq(level) + expect(msg).to eq(message) + calls += 1 + end + case level + when :debug + Facter.debugonce(message) + Facter.debugonce(message) + when :warn + Facter.warnonce(message) + Facter.warnonce(message) + else + raise 'unexpected logging level' + end + expect(calls).to eq(1) + end + + it 'does not call puts for debug or debugonce' do + subject.on_message {} + subject.expects(:puts).never + subject.debug('debug message') + subject.debugonce('debug once message') + end + + it 'passes debug messages to callback' do + log_message(:debug, 'debug message') + log_message_once(:debug, 'debug once message') + end + + it 'does not call Kernel.warn for warn or warnonce' do + subject.on_message {} + Kernel.expects(:warn).never + subject.warn('warn message') + subject.warnonce('warn once message') + end + + it 'passes warning messages to callback' do + log_message(:warn, 'warn message') + log_message_once(:warn, 'warn once message') + end + + it 'does not call $stderr.puts for show_time' do + subject.on_message {} + $stderr.expects(:puts).never + subject.show_time('debug message') + end + + it 'passes info messages to callback' do + log_message(:info, 'timing message') + end + end end diff -Nru facter-2.3.0/spec/unit/dhcp_servers_spec.rb facter-2.4.6/spec/unit/dhcp_servers_spec.rb --- facter-2.3.0/spec/unit/dhcp_servers_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/dhcp_servers_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -18,6 +18,7 @@ Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d list iface eth0").returns(my_fixture_read("nmcli_eth0_dhcp")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d list iface wlan0").returns(my_fixture_read("nmcli_wlan0_dhcp")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE nm 2>/dev/null').returns("connected\n") end it "should produce a dhcp_servers fact that includes values for 'system' as well as each dhcp enabled interface" do @@ -30,6 +31,7 @@ Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d list iface eth0").returns(my_fixture_read("nmcli_eth0_static")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d list iface wlan0").returns(my_fixture_read("nmcli_wlan0_dhcp")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE nm 2>/dev/null').returns("connected\n") end it "should a dhcp_servers fact that includes values for each dhcp enables interface and NO 'system' value" do @@ -43,6 +45,7 @@ Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d list iface eth0").returns(my_fixture_read("nmcli_eth0_dhcp")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d list iface wlan0").returns(my_fixture_read("nmcli_wlan0_dhcp")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE nm 2>/dev/null').returns("connected\n") end it "should a dhcp_servers fact that includes values for each dhcp enables interface and NO 'system' value" do @@ -55,6 +58,7 @@ Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d list iface eth0").returns(my_fixture_read("nmcli_eth0_static")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d list iface wlan0").returns(my_fixture_read("nmcli_wlan0_static")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE nm 2>/dev/null').returns("connected\n") end it "should not produce a dhcp_servers fact" do @@ -65,6 +69,7 @@ describe "with no CONNECTED devices" do before :each do Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices_disconnected")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE nm 2>/dev/null').returns("disconnected\n") end it "should not produce a dhcp_servers fact" do @@ -84,6 +89,7 @@ Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d show eth0").returns(my_fixture_read("nmcli_eth0_dhcp")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d show wlan0").returns(my_fixture_read("nmcli_wlan0_dhcp")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE g 2>/dev/null').returns("connected\n") end it "should produce a dhcp_servers fact that includes values for 'system' as well as each dhcp enabled interface" do @@ -96,6 +102,7 @@ Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d show eth0").returns(my_fixture_read("nmcli_eth0_static")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d show wlan0").returns(my_fixture_read("nmcli_wlan0_dhcp")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE g 2>/dev/null').returns("connected\n") end it "should a dhcp_servers fact that includes values for each dhcp enables interface and NO 'system' value" do @@ -109,6 +116,7 @@ Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d show eth0").returns(my_fixture_read("nmcli_eth0_dhcp")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d show wlan0").returns(my_fixture_read("nmcli_wlan0_dhcp")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE g 2>/dev/null').returns("connected\n") end it "should a dhcp_servers fact that includes values for each dhcp enables interface and NO 'system' value" do @@ -121,6 +129,7 @@ Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d show eth0").returns(my_fixture_read("nmcli_eth0_static")) Facter::Core::Execution.stubs(:exec).with("nmcli -f all d show wlan0").returns(my_fixture_read("nmcli_wlan0_static")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE g 2>/dev/null').returns("connected\n") end it "should not produce a dhcp_servers fact" do @@ -131,6 +140,7 @@ describe "with no CONNECTED devices" do before :each do Facter::Core::Execution.stubs(:exec).with("nmcli d").returns(my_fixture_read("nmcli_devices_disconnected")) + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE g 2>/dev/null').returns("disconnected\n") end it "should not produce a dhcp_servers fact" do @@ -139,6 +149,56 @@ end end + describe 'without NetworkManager running' do + before :each do + Facter::Core::Execution.stubs(:which).with('nmcli').returns('/usr/bin/nmcli') + end + + describe 'with nmcli version >= 0.9.9 available' do + before :each do + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE g 2>/dev/null').returns("unknown\n") + Facter::Core::Execution.stubs(:exec).with('nmcli --version').returns('nmcli tool, version 0.9.9.0') + end + + it 'should not produce a dhcp_servers fact' do + Facter.fact(:dhcp_servers).value.should be_nil + end + end + + describe 'with nmcli version <= 0.9.8 available' do + before :each do + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE nm 2>/dev/null').returns("unknown\n") + Facter::Core::Execution.stubs(:exec).with('nmcli --version').returns('nmcli tool, version 0.9.7.0') + end + + it 'should not produce a dhcp_servers fact' do + Facter.fact(:dhcp_servers).value.should be_nil + end + end + describe 'with nmcli version >= 0.9.9 available but printing an error to STDERR' do + before :each do + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE g 2>/dev/null').returns("\n") + Facter::Core::Execution.stubs(:exec).with('nmcli --version').returns('nmcli tool, version 0.9.9.0') + end + + it 'should not produce a dhcp_servers fact' do + Facter.fact(:dhcp_servers).value.should be_nil + end + end + + describe 'with nmcli version <= 0.9.8 available but printing an error to STDERR' do + before :each do + Facter::Core::Execution.stubs(:exec).with('nmcli -t -f STATE nm 2>/dev/null').returns("\n") + Facter::Core::Execution.stubs(:exec).with('nmcli --version').returns('nmcli tool, version 0.9.7.0') + end + + it 'should not produce a dhcp_servers fact' do + Facter.fact(:dhcp_servers).value.should be_nil + end + end + + end + describe "without nmcli available" do before :each do Facter::Core::Execution.stubs(:which).with('nmcli').returns(nil) diff -Nru facter-2.3.0/spec/unit/ec2/rest_spec.rb facter-2.4.6/spec/unit/ec2/rest_spec.rb --- facter-2.3.0/spec/unit/ec2/rest_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/ec2/rest_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -114,6 +114,23 @@ end end + it 'filters out IAM security credentials' do + subject.expects(:fetch_endpoint).with('').returns(['iam/']) + subject.expects(:fetch_endpoint).with('iam/').returns(['foo', 'security-credentials/', 'bar/']) + subject.expects(:fetch_endpoint).with('iam/foo').returns(['baz']) + subject.expects(:fetch_endpoint).with('iam/bar/').returns(['baz']) + subject.expects(:fetch_endpoint).with('iam/bar/baz').returns(['foo']) + output = subject.fetch + expect(output).to eq({ + 'iam' => { + 'foo' => 'baz', + 'bar' => { + 'baz' => 'foo' + } + } + }) + end + it_behaves_like "an ec2 rest querier" end diff -Nru facter-2.3.0/spec/unit/gid_spec.rb facter-2.4.6/spec/unit/gid_spec.rb --- facter-2.3.0/spec/unit/gid_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/gid_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -39,4 +39,13 @@ Facter.fact(:gid).value.should == nil end end + + describe "on windows systems" do + it "is not supported" do + Facter.fact(:kernel).stubs(:value).returns("windows") + Facter::Core::Execution.expects(:which).with('id').returns(true) + + Facter.fact(:gid).value.should == nil + end + end end diff -Nru facter-2.3.0/spec/unit/ldom_spec.rb facter-2.4.6/spec/unit/ldom_spec.rb --- facter-2.3.0/spec/unit/ldom_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/ldom_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -57,10 +57,6 @@ it "should return correct serial on version 1.0" do Facter.fact(:ldom_domainchassis).value.should == "0704RB0280" end - - it "should return correct virtual on version 1.0" do - Facter.fact(:virtual).value.should == "LDoms" - end end describe "when running on non ldom hardware" do diff -Nru facter-2.3.0/spec/unit/operatingsystem/implementation_spec.rb facter-2.4.6/spec/unit/operatingsystem/implementation_spec.rb --- facter-2.3.0/spec/unit/operatingsystem/implementation_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/operatingsystem/implementation_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -2,6 +2,7 @@ require 'facter/operatingsystem/implementation' require 'facter/operatingsystem/base' require 'facter/operatingsystem/cumuluslinux' +require 'facter/operatingsystem/osreleaselinux' require 'facter/operatingsystem/linux' require 'facter/operatingsystem/sunos' require 'facter/operatingsystem/vmkernel' diff -Nru facter-2.3.0/spec/unit/operatingsystem/linux_spec.rb facter-2.4.6/spec/unit/operatingsystem/linux_spec.rb --- facter-2.3.0/spec/unit/operatingsystem/linux_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/operatingsystem/linux_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -298,7 +298,7 @@ end describe "Operatingsystemmajrelease key" do - ['Amazon' 'AristaEOS', 'CentOS','CloudLinux','Debian','Fedora','OEL','OracleLinux','OVS','RedHat','Scientific','SLC','CumulusLinux'].each do |operatingsystem| + ['Amazon' 'AristaEOS', 'CentOS','CloudLinux','Debian','Fedora','OEL','OracleLinux','OVS','RedHat','Scientific','SLC','CumulusLinux','CoreOS'].each do |operatingsystem| describe "on #{operatingsystem} operatingsystems" do it "should be derived from operatingsystemrelease" do subject.stubs(:get_operatingsystem).returns(operatingsystem) diff -Nru facter-2.3.0/spec/unit/operatingsystem/sunos_spec.rb facter-2.4.6/spec/unit/operatingsystem/sunos_spec.rb --- facter-2.3.0/spec/unit/operatingsystem/sunos_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/operatingsystem/sunos_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -84,7 +84,6 @@ 'Solaris 10 5/09 s10x_u7wos_08 X86' => '10_u7', 'Solaris 10 10/09 s10x_u8wos_08a X86' => '10_u8', 'Oracle Solaris 10 9/10 s10x_u9wos_14a X86' => '10_u9', - 'Oracle Solaris 10 9/10 s10x_u9wos_14a X86' => '10_u9', 'Oracle Solaris 10 8/11 s10x_u10wos_17b X86' => '10_u10', 'Oracle Solaris 11 11/11 X86' => '11 11/11', 'Oracle Solaris 11.1 SPARC' => '11.1' diff -Nru facter-2.3.0/spec/unit/partitions_spec.rb facter-2.4.6/spec/unit/partitions_spec.rb --- facter-2.3.0/spec/unit/partitions_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/partitions_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -18,7 +18,7 @@ Facter.fact(:kernel).stubs(:value).returns("Linux") end - it "should return a structured fact with uuid, size, mount point and filesytem for each partition" do + it "should return a structured fact with uuid, size, label (if available), mount point and filesytem for each partition" do partitions = { 'sda1' => { 'uuid' => '13459663-22cc-47b4-a9e6-21dea9906e03', @@ -29,6 +29,7 @@ 'sdb2' => { 'uuid' => '98043570-eb10-457f-9718-0b85a26e66bf', 'size' => '5678', + 'label' => 'homes', 'mount' => '/home', 'filesystem' => 'xfs', }, @@ -39,13 +40,14 @@ partitions.each do |part,vals| Facter::Util::Partitions.stubs(:uuid).with(part).returns(vals['uuid']) Facter::Util::Partitions.stubs(:size).with(part).returns(vals['size']) + Facter::Util::Partitions.stubs(:label).with(part).returns(vals['label']) Facter::Util::Partitions.stubs(:mount).with(part).returns(vals['mount']) Facter::Util::Partitions.stubs(:filesystem).with(part).returns(vals['filesystem']) end Facter.fact(:partitions).value.should == { 'sda1' => { 'uuid' => '13459663-22cc-47b4-a9e6-21dea9906e03', 'size' => '1234', 'mount' => '/', 'filesystem' => 'ext4' }, - 'sdb2' => { 'uuid' => '98043570-eb10-457f-9718-0b85a26e66bf', 'size' => '5678', 'mount' => '/home', 'filesystem' => 'xfs' }, + 'sdb2' => { 'uuid' => '98043570-eb10-457f-9718-0b85a26e66bf', 'size' => '5678', 'label' => 'homes', 'mount' => '/home', 'filesystem' => 'xfs' }, } end end diff -Nru facter-2.3.0/spec/unit/processors/os_spec.rb facter-2.4.6/spec/unit/processors/os_spec.rb --- facter-2.3.0/spec/unit/processors/os_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/processors/os_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -40,6 +40,13 @@ expect(count).to eq 2 end + it "should be 2 in ppc64le fixture on Linux" do + Facter.fact(:architecture).stubs(:value).returns("ppc64le") + File.expects(:readlines).with("/proc/cpuinfo").returns(cpuinfo_fixture_readlines("ppc64le")) + count = subject.get_processor_count + expect(count).to eq 2 + end + it "should be 2 in panda-armel fixture on Linux" do Facter.fact(:architecture).stubs(:value).returns("arm") File.expects(:readlines).with("/proc/cpuinfo").returns(cpuinfo_fixture_readlines("panda-armel")) @@ -214,6 +221,7 @@ before :each do proc = stubs 'proc' proc.stubs(:Name).returns("Intel(R) Celeron(R) processor") + proc.stubs(:ole_respond_to?).with(:NumberOfLogicalProcessors).returns(false) load(Array.new(2, proc)) end @@ -228,6 +236,7 @@ before :each do proc = stubs 'proc' proc.stubs(:NumberOfLogicalProcessors).returns(2) + proc.stubs(:ole_respond_to?).with(:NumberOfLogicalProcessors).returns(true) proc.stubs(:Name).returns("Intel(R) Celeron(R) processor") load(Array.new(2, proc)) end diff -Nru facter-2.3.0/spec/unit/selinux_spec.rb facter-2.4.6/spec/unit/selinux_spec.rb --- facter-2.3.0/spec/unit/selinux_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/selinux_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -96,6 +96,11 @@ Facter.fact(:selinux_config_policy).value.should == "targeted" end + it "should return the loaded SELinux policy" do + sestatus_is(my_fixture_read("selinux_sestatus2")) + + Facter.fact(:selinux_config_policy).value.should == "default" + end end def sestatus_is(status) diff -Nru facter-2.3.0/spec/unit/system32_spec.rb facter-2.4.6/spec/unit/system32_spec.rb --- facter-2.3.0/spec/unit/system32_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/system32_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -12,7 +12,7 @@ describe "when running in 32-bit ruby" do it "resolves to sysnative" do - File.expects(:exists?).with(sysnative).returns(true) + File.expects(:exist?).with(sysnative).returns(true) expect(Facter.fact(:system32).value).to eq(sysnative) end @@ -20,7 +20,7 @@ describe "when running in 64-bit ruby" do it "resolves to system32" do - File.expects(:exists?).with(sysnative).returns(false) + File.expects(:exist?).with(sysnative).returns(false) expect(Facter.fact(:system32).value).to eq(system32) end diff -Nru facter-2.3.0/spec/unit/util/config_spec.rb facter-2.4.6/spec/unit/util/config_spec.rb --- facter-2.3.0/spec/unit/util/config_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/util/config_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -55,7 +55,7 @@ Facter::Util::Config.stubs(:is_windows?).returns(false) Facter::Util::Config.stubs(:windows_data_dir).returns(nil) Facter::Util::Config.setup_default_ext_facts_dirs - Facter::Util::Config.external_facts_dirs.should == ["/etc/facter/facts.d", "/etc/puppetlabs/facter/facts.d"] + Facter::Util::Config.external_facts_dirs.should == ["/opt/puppetlabs/facter/facts.d", "/etc/facter/facts.d", "/etc/puppetlabs/facter/facts.d"] end it "should return the default value for windows 2008" do @@ -72,10 +72,11 @@ Facter::Util::Config.external_facts_dirs.should == [File.join("C:\\Documents", 'PuppetLabs', 'facter', 'facts.d')] end - it "returns the users home directory when not root" do + it "returns the old and new (AIO) paths under user's home directory when not root" do Facter::Util::Root.stubs(:root?).returns(false) Facter::Util::Config.setup_default_ext_facts_dirs - Facter::Util::Config.external_facts_dirs.should == [File.expand_path(File.join("~", ".facter", "facts.d"))] + Facter::Util::Config.external_facts_dirs.should == [File.expand_path(File.join("~", ".puppetlabs", "opt", "facter", "facts.d")), + File.expand_path(File.join("~", ".facter", "facts.d"))] end it "includes additional values when user appends to the list" do @@ -94,4 +95,26 @@ end end + + describe "override_binary_dir" do + it "should return the default value for linux" do + Facter::Util::Config.stubs(:is_windows?).returns(false) + Facter::Util::Config.setup_default_override_binary_dir + Facter::Util::Config.override_binary_dir.should == "/opt/puppetlabs/puppet/bin" + end + + it "should return nil for windows" do + Facter::Util::Config.stubs(:is_windows?).returns(true) + Facter::Util::Config.setup_default_override_binary_dir + Facter::Util::Config.override_binary_dir.should == nil + end + + it "should output new values when explicitly set" do + Facter::Util::Config.setup_default_override_binary_dir + new_value = '/usr/share/newdir' + Facter::Util::Config.override_binary_dir = new_value + Facter::Util::Config.override_binary_dir.should == new_value + end + end + end diff -Nru facter-2.3.0/spec/unit/util/directory_loader_spec.rb facter-2.4.6/spec/unit/util/directory_loader_spec.rb --- facter-2.3.0/spec/unit/util/directory_loader_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/util/directory_loader_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -71,7 +71,7 @@ end it "external facts should almost always precedence over all other facts" do - Facter.add("f1", :value => "lower_weight_fact") { has_weight(Facter::Util::DirectoryLoader::EXTERNAL_FACT_WEIGHT - 1) } + collection.add("f1", :value => "lower_weight_fact") { has_weight(Facter::Util::DirectoryLoader::EXTERNAL_FACT_WEIGHT - 1) } data = {"f1" => "external_fact"} write_to_file("data.yaml", YAML.dump(data)) @@ -79,6 +79,20 @@ collection.value("f1").should == "external_fact" end + + describe "given a custom weight" do + subject { Facter::Util::DirectoryLoader.new(tmpdir('directory_loader'), 10) } + + it "should set that weight for loaded external facts" do + collection.add("f1", :value => "higher_weight_fact") { has_weight(11) } + data = {"f1" => "external_fact"} + write_to_file("data.yaml", YAML.dump(data)) + + subject.load(collection) + + collection.value("f1").should == "higher_weight_fact" + end + end end def write_to_file(file_name, to_write) diff -Nru facter-2.3.0/spec/unit/util/operatingsystem_spec.rb facter-2.4.6/spec/unit/util/operatingsystem_spec.rb --- facter-2.3.0/spec/unit/util/operatingsystem_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/util/operatingsystem_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -19,6 +19,21 @@ }) end + it "correctly parses the file on CoreOS Linux" do + values = described_class.os_release(my_fixture('coreos.txt')) + + expect(values).to eq({ + 'NAME' => "CoreOS", + 'VERSION_ID' => "575.0.0", + 'VERSION' => "575.0.0", + 'PRETTY_NAME' => "CoreOS 575.0.0", + 'ID' => "coreos", + 'HOME_URL' => "https://coreos.com/", + 'BUG_REPORT_URL' => "https://github.com/coreos/bugs/issues", + 'ANSI_COLOR' => "1;32", + }) + end + it "correctly parses the file on Sabayon" do values = described_class.os_release(my_fixture('sabayon.txt')) diff -Nru facter-2.3.0/spec/unit/util/uptime_spec.rb facter-2.4.6/spec/unit/util/uptime_spec.rb --- facter-2.3.0/spec/unit/util/uptime_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/util/uptime_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -28,13 +28,13 @@ it "should use 'sysctl -n kern.boottime' on OpenBSD" do Facter::Util::POSIX.stubs(:sysctl).returns(my_fixture_read("sysctl_kern_boottime_openbsd")) - Time.stubs(:now).returns Time.parse("Dec 09 22:11:46 +0000 2011") # one hour later + Time.stubs(:now).returns Time.utc(2011,12,9,22,11,46) # one hour later Facter::Util::Uptime.get_uptime_seconds_unix.should == 60 * 60 end it "should use 'sysctl -n kern.boottime' on Darwin, etc." do Facter::Util::POSIX.stubs(:sysctl).returns(my_fixture_read("sysctl_kern_boottime_darwin")) - Time.stubs(:now).returns Time.parse("Oct 30 22:52:27 +0000 2011") # one hour later + Time.stubs(:now).returns Time.utc(2011,10,30,22,52,27) # one hour later Facter::Util::Uptime.get_uptime_seconds_unix.should == 60 * 60 end @@ -52,6 +52,9 @@ # Solaris differs from all other Unices (and Linux) in that the plural/singular case of minutes/hours/days are # written min(s)/hr(s)/day(s) instead of min/mins/hr/hrs etc., e.g. 1 min(s), 2 min(s) as opposed to # 1 min, 2 mins, etc. + # The coreutils package can be installed in Solaris, which brings in a GNU version of uptime. The output + # from this binary differs in that is is missing the comma after "day(s)" + # Some versions of uptime in Solaris may also include a '-' character in the minutes field. # AIX (4.3.3, 5.2, 5.3, 6.1) differs from other SysV Unices in that times are padded with a leading 0 in the # hour column where necessary, and have AM/PM in uppercase, and there are three spaces before 'up'. # Tru64 (4.0, 5.1) differs from other SysV Unices in that times are in 24 hour format, and there are no @@ -93,19 +96,22 @@ [' 3:01pm up 4496 day(s), 21:19, 32 users, load average: 0.61, 0.62, 0.62', 4496*24*60*60 + 21*60*60 + 19*60], [' 02:42PM up 41 days, 2:38, 0 users, load average: 0.38, 0.70, 0.55', 41*24*60*60 + 2*60*60 + 38*60], [' 18:13:29 up 25 days, 21:36, 0 users, load average: 0.00, 0.00, 0.00', 25*24*60*60 + 21*60*60 + 36*60], - [' 13:36:05 up 118 days, 1:15, 1 user, load average: 0.00, 0.00, 0.00', 118*24*60*60 + 1*60*60 + 15*60] + [' 13:36:05 up 118 days, 1:15, 1 user, load average: 0.00, 0.00, 0.00', 118*24*60*60 + 1*60*60 + 15*60], + ['10:27am up 1 day 7:26, 1 user, load average: 0.00, 0.00, 0.00', 1*24*60*60 + 7*60*60 + 26*60], + ['22:45pm up 0:-6, 1 user, load average: 0.00, 0.00, 0.00', 6*60], + ['22:45pm up 1 day 0:-6, 1 user, load average: 0.00, 0.00, 0.00', 1*24*60*60 + 6*60] ] test_cases.each do |uptime, expected| it "should return #{expected} for #{uptime}" do - Facter::Core::Execution.stubs(:execute).with('/usr/bin/uptime 2>/dev/null', {:on_fail => nil}).returns(uptime) + Facter::Core::Execution.stubs(:execute).with('uptime 2>/dev/null', {:on_fail => nil}).returns(uptime) Facter.fact(:uptime_seconds).value.should == expected end end describe "nor is 'uptime' command" do before :each do - Facter::Core::Execution.stubs(:execute).with('/usr/bin/uptime 2>/dev/null', {:on_fail => nil}).returns(nil) + Facter::Core::Execution.stubs(:execute).with('uptime 2>/dev/null', {:on_fail => nil}).returns(nil) end it "should return nil" do diff -Nru facter-2.3.0/spec/unit/util/virtual_spec.rb facter-2.4.6/spec/unit/util/virtual_spec.rb --- facter-2.3.0/spec/unit/util/virtual_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/util/virtual_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -278,10 +278,15 @@ mockfile end - shared_examples_for "virt-what" do |kernel, path, null_device| + shared_examples_for "virt-what" do |kernel, path, null_device, override_location| before(:each) do Facter.fact(:kernel).stubs(:value).returns(kernel) - Facter::Core::Execution.expects(:which).with("virt-what").returns(path) + if override_location + Facter::Core::Execution.expects(:which).with(File.join(Facter::Util::Config.override_binary_dir, "virt-what")).returns(path) + else + Facter::Core::Execution.expects(:which).with(File.join(Facter::Util::Config.override_binary_dir, "virt-what")).returns(nil) + Facter::Core::Execution.expects(:which).with("virt-what").returns(path) + end Facter::Core::Execution.expects(:exec).with("#{path} 2>#{null_device}") end @@ -291,23 +296,28 @@ end context "on linux" do - it_should_behave_like "virt-what", "linux", "/usr/bin/virt-what", "/dev/null" - - it "should strip out warnings on stdout from virt-what" do - virt_what_warning = "virt-what: this script must be run as root" - Facter.fact(:kernel).stubs(:value).returns('linux') - Facter::Core::Execution.expects(:which).with('virt-what').returns "/usr/bin/virt-what" - Facter::Core::Execution.expects(:exec).with('/usr/bin/virt-what 2>/dev/null').returns virt_what_warning - Facter::Util::Virtual.virt_what.should_not match /^virt-what: / + describe "override binary dir doesn't exist" do + it_should_behave_like "virt-what", "linux", "/usr/bin/virt-what", "/dev/null", true + it_should_behave_like "virt-what", "linux", "/usr/bin/virt-what", "/dev/null", false + + it "should strip out warnings on stdout from virt-what" do + virt_what_warning = "virt-what: this script must be run as root" + Facter.fact(:kernel).stubs(:value).returns('linux') + Facter::Core::Execution.expects(:which).with(File.join(Facter::Util::Config.override_binary_dir, "virt-what")).returns(nil) + Facter::Core::Execution.expects(:which).with('virt-what').returns "/usr/bin/virt-what" + Facter::Core::Execution.expects(:exec).with('/usr/bin/virt-what 2>/dev/null').returns virt_what_warning + Facter::Util::Virtual.virt_what.should_not match /^virt-what: / + end end end context "on unix" do - it_should_behave_like "virt-what", "unix", "/usr/bin/virt-what", "/dev/null" + it_should_behave_like "virt-what", "unix", "/usr/bin/virt-what", "/dev/null", true + it_should_behave_like "virt-what", "unix", "/usr/bin/virt-what", "/dev/null", false end context "on windows" do - it_should_behave_like "virt-what", "windows", 'c:\windows\system32\virt-what', "NUL" + it_should_behave_like "virt-what", "windows", 'c:\windows\system32\virt-what', "NUL", false end describe '.lxc?' do @@ -353,6 +363,17 @@ Pathname.stubs(:new).with('/proc/1/cgroup').returns(fakepath) end + it 'is true' do + subject.should be_true + end + end + + context '/proc/1/cgroup has at least one hierarchy with docker underneath a systemd slice parent' do + before :each do + fakepath = Pathname.new(File.join(fixture_path, 'in_a_docker_container_with_systemd_slices')) + Pathname.stubs(:new).with('/proc/1/cgroup').returns(fakepath) + end + it 'is true' do subject.should be_true end diff -Nru facter-2.3.0/spec/unit/util/xendomains_spec.rb facter-2.4.6/spec/unit/util/xendomains_spec.rb --- facter-2.3.0/spec/unit/util/xendomains_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/util/xendomains_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -7,60 +7,108 @@ let(:xen0_domains) { my_fixture_read("xendomains") } - describe "when the xl command is present" do + describe "when the xen-toolstack command is present" do before do - Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xl').returns('/usr/sbin/xl') + File.expects(:file?).with('/usr/lib/xen-common/bin/xen-toolstack').returns true end - describe "and the xm command is not present" do - + describe "and the xen-toolstack returns xl" do before do - Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xm').returns(nil) - Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xm list 2>/dev/null').never + Facter::Util::Resolution.stubs(:exec).with('/usr/lib/xen-common/bin/xen-toolstack').returns('/usr/sbin/xl') end it "lists the domains running on Xen0 with the 'xl' command" do Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xl list 2>/dev/null').returns(xen0_domains) Facter::Util::Xendomains.get_domains.should == %{web01,mailserver} end + end - describe "and the xm command is also present" do + describe "and the xen-toolstack returns xm" do before do - Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xm').returns('/usr/bin/xm') - Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xm list 2>/dev/null').never + Facter::Util::Resolution.stubs(:exec).with('/usr/lib/xen-common/bin/xen-toolstack').returns('/usr/sbin/xm') end - it "prefers xl over xm" do - Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xl list 2>/dev/null').returns(xen0_domains) + it "lists the domains running on Xen0 with the 'xm' command" do + Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xm list 2>/dev/null').returns(xen0_domains) Facter::Util::Xendomains.get_domains.should == %{web01,mailserver} end + end + + describe "and the xen-toolstack returns nil" do + before do + Facter::Util::Resolution.stubs(:exec).with('/usr/lib/xen-common/bin/xen-toolstack').returns(nil) + end + + it "returns nil" do + Facter::Util::Xendomains.get_domains.should == nil + end + + end + end - describe "when xl is not present" do + describe "when the xen-toolstack command is not present" do before do - Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xl').returns(nil) - Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xl list 2>/dev/null').never + File.expects(:file?).with('/usr/lib/xen-common/bin/xen-toolstack').returns false end - describe "and the xm command is present" do + describe "and the xl command is present" do before do - Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xm').returns('/usr/sbin/xm') + Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xl').returns('/usr/sbin/xl') end - it "lists the domains running on Xen0 with the 'xm' command" do - Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xm list 2>/dev/null').returns(xen0_domains) - Facter::Util::Xendomains.get_domains.should == %{web01,mailserver} + describe "and the xm command is not present" do + + before do + Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xm').returns(nil) + Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xm list 2>/dev/null').never + end + + it "lists the domains running on Xen0 with the 'xl' command" do + Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xl list 2>/dev/null').returns(xen0_domains) + Facter::Util::Xendomains.get_domains.should == %{web01,mailserver} + end + end + + describe "and the xm command is also present" do + before do + Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xm').returns('/usr/bin/xm') + Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xm list 2>/dev/null').never + end + + it "prefers xl over xm" do + Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xl list 2>/dev/null').returns(xen0_domains) + Facter::Util::Xendomains.get_domains.should == %{web01,mailserver} + end + end + end + + describe "when xl is not present" do + before do + Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xl').returns(nil) + Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xl list 2>/dev/null').never + end + + describe "and the xm command is present" do + before do + Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xm').returns('/usr/sbin/xm') + end + + it "lists the domains running on Xen0 with the 'xm' command" do + Facter::Util::Resolution.expects(:exec).with('/usr/sbin/xm list 2>/dev/null').returns(xen0_domains) + Facter::Util::Xendomains.get_domains.should == %{web01,mailserver} + end end end - end - describe "neither xl or xm are present" do - it "returns nil" do - Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xl').returns(nil) - Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xm').returns(nil) - Facter::Util::Xendomains.get_domains.should == nil + describe "neither xl or xm are present" do + it "returns nil" do + Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xl').returns(nil) + Facter::Util::Resolution.stubs(:which).with('/usr/sbin/xm').returns(nil) + Facter::Util::Xendomains.get_domains.should == nil + end end end end diff -Nru facter-2.3.0/spec/unit/virtual_spec.rb facter-2.4.6/spec/unit/virtual_spec.rb --- facter-2.3.0/spec/unit/virtual_spec.rb 2014-10-30 20:50:44.000000000 +0000 +++ facter-2.4.6/spec/unit/virtual_spec.rb 2016-01-26 18:41:33.000000000 +0000 @@ -31,6 +31,18 @@ Facter.fact(:virtual).value.should == "zone" end + it "should be LDoms on Solaris when an ldom" do + ldom_fixture = File.read(fixtures('ldom', 'ldom_v1')) + Facter.fact(:kernel).stubs(:value).returns("SunOS") + Facter.fact(:operatingsystem).stubs(:value).returns("Solaris") + Facter.fact(:hardwareisa).stubs(:value).returns("sparc") + Facter::Core::Execution.stubs(:which).with("virtinfo").returns 'virtinfo' + Facter::Core::Execution.stubs(:which).with("vmware").returns nil + Facter::Core::Execution.stubs(:exec).with("virtinfo -ap").returns(ldom_fixture) + Facter.collection.internal_loader.load(:ldom) + Facter.fact(:virtual).value.should == "LDoms" + end + it "should be jail on FreeBSD when a jail in kvm" do Facter.fact(:kernel).stubs(:value).returns("FreeBSD") Facter::Util::Virtual.stubs(:jail?).returns(true) @@ -147,6 +159,15 @@ Facter.fact(:virtual).value.should == "xenu" end + it "should be xenu with xvda1 device in /dev" do + Facter.fact(:hardwaremodel).stubs(:value).returns("i386") + Facter::Util::Virtual.expects(:xen?).returns(true) + FileTest.expects(:exists?).with("/dev/xen/evtchn").returns(false) + FileTest.expects(:exists?).with("/proc/xen").returns(false) + FileTest.expects(:exists?).with("/dev/xvda1").returns(true) + Facter.fact(:virtual).value.should == "xenu" + end + it "should be xenhvm with Xen HVM vendor name from lspci 2>/dev/null" do Facter::Core::Execution.stubs(:exec).with('lspci 2>/dev/null').returns("00:03.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)") Facter.fact(:virtual).value.should == "xenhvm" @@ -184,6 +205,13 @@ Facter.fact(:virtual).value.should == "ovirt" end + it "should be kvm with KVM Node manufacturer name from dmidecode" do + Facter.fact(:kernel).stubs(:value).returns("Linux") + Facter::Core::Execution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) + Facter::Core::Execution.stubs(:exec).with('dmidecode 2> /dev/null').returns("Manufacturer: QEMU") + Facter.fact(:virtual).value.should == "kvm" + end + it "is gce based on DMI info" do Facter.fact(:kernel).stubs(:value).returns("Linux") Facter::Util::Virtual.stubs(:gce?).returns(true) @@ -201,6 +229,11 @@ Facter.fact(:virtual).value.should == "hyperv" end + it "should be kvm with virtio device lspci 2>/dev/null" do + Facter::Util::Virtual.expects(:lspci).returns("00:03.0 Ethernet controller: Red Hat, Inc Virtio network device") + Facter.fact(:virtual).value.should == "kvm" + end + context "In a Linux Container (LXC)" do before :each do Facter.fact(:kernel).stubs(:value).returns("Linux")