puppet 0.24.7 → 0.24.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CHANGELOG +72 -0
- data/README.rst +38 -0
- data/Rakefile +3 -1
- data/bin/filebucket +0 -0
- data/bin/puppet +0 -0
- data/bin/puppetca +0 -0
- data/bin/puppetd +0 -0
- data/bin/puppetdoc +0 -0
- data/bin/puppetmasterd +0 -0
- data/bin/puppetrun +0 -0
- data/bin/ralsh +4 -0
- data/conf/gentoo/init.d/puppetmaster +0 -0
- data/conf/osx/createpackage.sh +0 -0
- data/conf/osx/preflight +0 -0
- data/conf/redhat/puppet.spec +20 -3
- data/conf/solaris/smf/svc-puppetd +0 -0
- data/conf/solaris/smf/svc-puppetmasterd +0 -0
- data/examples/etc/init.d/sleeper +0 -0
- data/examples/mac_dscl.pp +0 -0
- data/examples/mac_dscl_revert.pp +0 -0
- data/examples/mac_netinfo.pp +0 -0
- data/examples/mac_pkgdmg.pp +0 -0
- data/ext/bin/sleeper +0 -0
- data/ext/dbfix.sql +132 -0
- data/ext/logcheck/puppet +2 -1
- data/ext/module_puppet +0 -0
- data/ext/nagios/check_puppet.rb +0 -0
- data/ext/puppet-test +0 -0
- data/ext/puppetlast +0 -0
- data/ext/vim/syntax/puppet.vim +2 -1
- data/install.rb +2 -2
- data/lib/puppet.rb +1 -1
- data/lib/puppet/daemon.rb +0 -0
- data/lib/puppet/defaults.rb +9 -0
- data/lib/puppet/executables/client/certhandler.rb +6 -1
- data/lib/puppet/external/base64.rb +0 -0
- data/lib/puppet/external/nagios.rb +0 -0
- data/lib/puppet/external/nagios/base.rb +0 -0
- data/lib/puppet/external/nagios/parser.rb +39 -57
- data/lib/puppet/file_collection.rb +30 -0
- data/lib/puppet/file_collection/lookup.rb +20 -0
- data/lib/puppet/indirector/facts/facter.rb +6 -2
- data/lib/puppet/indirector/node/ldap.rb +75 -39
- data/lib/puppet/network/authstore.rb +0 -0
- data/lib/puppet/network/handler/filebucket.rb +0 -0
- data/lib/puppet/network/handler/fileserver.rb +0 -0
- data/lib/puppet/network/handler/report.rb +0 -0
- data/lib/puppet/network/handler/resource.rb +0 -0
- data/lib/puppet/network/handler/runner.rb +0 -0
- data/lib/puppet/network/rights.rb +0 -0
- data/lib/puppet/network/xmlrpc/client.rb +113 -53
- data/lib/puppet/node/facts.rb +0 -0
- data/lib/puppet/parser/ast.rb +4 -3
- data/lib/puppet/parser/ast/astarray.rb +2 -1
- data/lib/puppet/parser/ast/leaf.rb +1 -1
- data/lib/puppet/parser/ast/resource.rb +20 -20
- data/lib/puppet/parser/ast/resource_override.rb +2 -2
- data/lib/puppet/parser/collector.rb +1 -2
- data/lib/puppet/parser/functions/realize.rb +1 -1
- data/lib/puppet/parser/functions/regsubst.rb +93 -0
- data/lib/puppet/parser/functions/sprintf.rb +17 -0
- data/lib/puppet/parser/functions/versioncmp.rb +10 -0
- data/lib/puppet/parser/resource.rb +10 -6
- data/lib/puppet/parser/resource/param.rb +17 -14
- data/lib/puppet/parser/resource/reference.rb +2 -0
- data/lib/puppet/parser/scope.rb +3 -3
- data/lib/puppet/property/list.rb +5 -1
- data/lib/puppet/provider/augeas/augeas.rb +146 -44
- data/lib/puppet/provider/cron/crontab.rb +0 -0
- data/lib/puppet/provider/mailalias/aliases.rb +0 -0
- data/lib/puppet/provider/maillist/mailman.rb +0 -0
- data/lib/puppet/provider/mount/parsed.rb +0 -0
- data/lib/puppet/provider/naginator.rb +7 -2
- data/lib/puppet/provider/nameservice/directoryservice.rb +128 -44
- data/lib/puppet/provider/package/apple.rb +0 -0
- data/lib/puppet/provider/package/apt.rb +0 -0
- data/lib/puppet/provider/package/aptitude.rb +0 -0
- data/lib/puppet/provider/package/blastwave.rb +0 -0
- data/lib/puppet/provider/package/darwinport.rb +0 -0
- data/lib/puppet/provider/package/dpkg.rb +0 -0
- data/lib/puppet/provider/package/fink.rb +0 -0
- data/lib/puppet/provider/package/freebsd.rb +0 -0
- data/lib/puppet/provider/package/gem.rb +0 -0
- data/lib/puppet/provider/package/openbsd.rb +0 -0
- data/lib/puppet/provider/package/ports.rb +0 -0
- data/lib/puppet/provider/package/rpm.rb +0 -0
- data/lib/puppet/provider/package/sun.rb +0 -0
- data/lib/puppet/provider/package/sunfreeware.rb +0 -0
- data/lib/puppet/provider/package/up2date.rb +4 -2
- data/lib/puppet/provider/package/yum.rb +0 -0
- data/lib/puppet/provider/parsedfile.rb +47 -22
- data/lib/puppet/provider/port/parsed.rb +0 -0
- data/lib/puppet/provider/service/base.rb +0 -0
- data/lib/puppet/provider/service/debian.rb +0 -0
- data/lib/puppet/provider/service/gentoo.rb +1 -1
- data/lib/puppet/provider/service/init.rb +0 -0
- data/lib/puppet/provider/service/launchd.rb +13 -4
- data/lib/puppet/provider/service/redhat.rb +5 -5
- data/lib/puppet/provider/service/smf.rb +0 -0
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +43 -16
- data/lib/puppet/provider/sshkey/parsed.rb +0 -0
- data/lib/puppet/provider/user/useradd.rb +1 -1
- data/lib/puppet/rails/database/003_add_environment_to_host.rb +6 -2
- data/lib/puppet/rails/host.rb +70 -19
- data/lib/puppet/rails/param_value.rb +31 -12
- data/lib/puppet/rails/resource.rb +36 -9
- data/lib/puppet/rails/resource_tag.rb +18 -0
- data/lib/puppet/reference/report.rb +1 -0
- data/lib/puppet/reports.rb +0 -0
- data/lib/puppet/sslcertificates.rb +0 -0
- data/lib/puppet/transaction.rb +1 -1
- data/lib/puppet/type.rb +2 -6
- data/lib/puppet/type/augeas.rb +23 -15
- data/lib/puppet/type/cron.rb +0 -0
- data/lib/puppet/type/exec.rb +0 -0
- data/lib/puppet/type/file/checksum.rb +7 -35
- data/lib/puppet/type/file/content.rb +11 -8
- data/lib/puppet/type/file/ensure.rb +0 -0
- data/lib/puppet/type/file/group.rb +0 -0
- data/lib/puppet/type/file/mode.rb +0 -0
- data/lib/puppet/type/file/owner.rb +0 -0
- data/lib/puppet/type/file/selcontext.rb +8 -0
- data/lib/puppet/type/file/source.rb +0 -0
- data/lib/puppet/type/file/type.rb +0 -0
- data/lib/puppet/type/filebucket.rb +0 -0
- data/lib/puppet/type/group.rb +0 -0
- data/lib/puppet/type/host.rb +0 -0
- data/lib/puppet/type/mailalias.rb +0 -0
- data/lib/puppet/type/maillist.rb +0 -0
- data/lib/puppet/type/mount.rb +0 -0
- data/lib/puppet/type/port.rb +0 -0
- data/lib/puppet/type/schedule.rb +0 -0
- data/lib/puppet/type/ssh_authorized_key.rb +14 -0
- data/lib/puppet/type/sshkey.rb +0 -0
- data/lib/puppet/type/tidy.rb +0 -0
- data/lib/puppet/type/user.rb +6 -0
- data/lib/puppet/type/yumrepo.rb +4 -1
- data/lib/puppet/type/zfs.rb +0 -0
- data/lib/puppet/type/zpool.rb +0 -0
- data/lib/puppet/util/autoload.rb +2 -2
- data/lib/puppet/util/filetype.rb +7 -96
- data/lib/puppet/util/inifile.rb +1 -0
- data/lib/puppet/util/instance_loader.rb +0 -0
- data/lib/puppet/util/loadedfile.rb +0 -0
- data/lib/puppet/util/nagios_maker.rb +4 -0
- data/lib/puppet/util/package.rb +2 -0
- data/lib/puppet/util/posix.rb +0 -0
- data/lib/puppet/util/rails/reference_serializer.rb +18 -0
- data/lib/puppet/util/selinux.rb +3 -1
- data/spec/integration/checksum.rb +1 -0
- data/spec/integration/defaults.rb +9 -0
- data/spec/integration/file_serving/configuration.rb +0 -0
- data/spec/integration/file_serving/content.rb +0 -0
- data/spec/integration/file_serving/metadata.rb +0 -0
- data/spec/integration/indirector/direct_file_server.rb +0 -0
- data/spec/integration/indirector/file_content/file_server.rb +0 -0
- data/spec/integration/indirector/file_metadata/file_server.rb +0 -0
- data/spec/integration/indirector/module_files.rb +0 -0
- data/spec/integration/indirector/node/ldap.rb +0 -0
- data/spec/integration/indirector/rest.rb +0 -0
- data/spec/integration/network/server/mongrel.rb +0 -0
- data/spec/integration/network/server/webrick.rb +0 -0
- data/spec/integration/node.rb +0 -0
- data/spec/integration/node/catalog.rb +0 -0
- data/spec/integration/node/facts.rb +0 -0
- data/spec/integration/provider/package.rb +0 -0
- data/spec/integration/provider/service/init.rb +0 -0
- data/spec/integration/reference/providers.rb +0 -0
- data/spec/integration/reports.rb +4 -0
- data/spec/integration/transaction/report.rb +7 -1
- data/spec/integration/type/package.rb +5 -2
- data/spec/integration/util/file_locking.rb +0 -0
- data/spec/unit/executables/client/certhandler.rb +13 -0
- data/spec/unit/file_collection.rb +53 -0
- data/spec/unit/file_collection/lookup.rb +46 -0
- data/spec/unit/file_serving/configuration.rb +0 -0
- data/spec/unit/file_serving/configuration/parser.rb +0 -0
- data/spec/unit/file_serving/content.rb +0 -0
- data/spec/unit/file_serving/file_base.rb +0 -0
- data/spec/unit/file_serving/fileset.rb +0 -0
- data/spec/unit/file_serving/indirection_hooks.rb +0 -0
- data/spec/unit/file_serving/metadata.rb +0 -0
- data/spec/unit/file_serving/mount.rb +0 -0
- data/spec/unit/file_serving/terminus_helper.rb +0 -0
- data/spec/unit/indirector.rb +0 -0
- data/spec/unit/indirector/catalog/compiler.rb +0 -0
- data/spec/unit/indirector/catalog/yaml.rb +0 -0
- data/spec/unit/indirector/checksum/file.rb +0 -0
- data/spec/unit/indirector/code.rb +0 -0
- data/spec/unit/indirector/direct_file_server.rb +0 -0
- data/spec/unit/indirector/envelope.rb +0 -0
- data/spec/unit/indirector/exec.rb +0 -0
- data/spec/unit/indirector/facts/facter.rb +27 -2
- data/spec/unit/indirector/facts/yaml.rb +0 -0
- data/spec/unit/indirector/file.rb +0 -0
- data/spec/unit/indirector/file_content/file.rb +0 -0
- data/spec/unit/indirector/file_content/file_server.rb +0 -0
- data/spec/unit/indirector/file_content/modules.rb +0 -0
- data/spec/unit/indirector/file_content/rest.rb +0 -0
- data/spec/unit/indirector/file_metadata/file.rb +0 -0
- data/spec/unit/indirector/file_metadata/file_server.rb +0 -0
- data/spec/unit/indirector/file_metadata/modules.rb +0 -0
- data/spec/unit/indirector/file_metadata/rest.rb +0 -0
- data/spec/unit/indirector/file_server.rb +0 -0
- data/spec/unit/indirector/indirection.rb +0 -0
- data/spec/unit/indirector/ldap.rb +0 -0
- data/spec/unit/indirector/memory.rb +0 -0
- data/spec/unit/indirector/module_files.rb +0 -0
- data/spec/unit/indirector/node/exec.rb +0 -0
- data/spec/unit/indirector/node/ldap.rb +20 -0
- data/spec/unit/indirector/node/memory.rb +0 -0
- data/spec/unit/indirector/node/plain.rb +0 -0
- data/spec/unit/indirector/node/rest.rb +0 -0
- data/spec/unit/indirector/node/yaml.rb +0 -0
- data/spec/unit/indirector/plain.rb +0 -0
- data/spec/unit/indirector/report/processor.rb +0 -0
- data/spec/unit/indirector/request.rb +0 -0
- data/spec/unit/indirector/rest.rb +0 -0
- data/spec/unit/indirector/ssl_rsa/file.rb +5 -0
- data/spec/unit/indirector/terminus.rb +0 -0
- data/spec/unit/indirector/yaml.rb +0 -0
- data/spec/unit/module.rb +0 -0
- data/spec/unit/network/client.rb +0 -0
- data/spec/unit/network/client/master.rb +0 -0
- data/spec/unit/network/http.rb +0 -0
- data/spec/unit/network/http/mongrel.rb +0 -0
- data/spec/unit/network/http/mongrel/rest.rb +0 -0
- data/spec/unit/network/http/mongrel/xmlrpc.rb +0 -0
- data/spec/unit/network/http/webrick.rb +0 -0
- data/spec/unit/network/http/webrick/rest.rb +0 -0
- data/spec/unit/network/http/webrick/xmlrpc.rb +0 -0
- data/spec/unit/network/http_pool.rb +0 -0
- data/spec/unit/network/server.rb +0 -0
- data/spec/unit/network/xmlrpc/client.rb +165 -7
- data/spec/unit/node.rb +0 -0
- data/spec/unit/node/catalog.rb +1 -0
- data/spec/unit/node/environment.rb +0 -0
- data/spec/unit/node/facts.rb +0 -0
- data/spec/unit/other/checksum.rb +0 -0
- data/spec/unit/other/pgraph.rb +0 -0
- data/spec/unit/other/transbucket.rb +4 -4
- data/spec/unit/other/transobject.rb +0 -0
- data/spec/unit/parameter.rb +0 -0
- data/spec/unit/parser/ast.rb +5 -1
- data/spec/unit/parser/ast/arithmetic_operator.rb +0 -0
- data/spec/unit/parser/ast/astarray.rb +2 -2
- data/spec/unit/parser/ast/boolean_operator.rb +0 -0
- data/spec/unit/parser/ast/collexpr.rb +0 -0
- data/spec/unit/parser/ast/comparison_operator.rb +0 -0
- data/spec/unit/parser/ast/definition.rb +0 -0
- data/spec/unit/parser/ast/hostclass.rb +0 -0
- data/spec/unit/parser/ast/minus.rb +0 -0
- data/spec/unit/parser/ast/node.rb +0 -0
- data/spec/unit/parser/ast/nop.rb +0 -0
- data/spec/unit/parser/ast/not.rb +0 -0
- data/spec/unit/parser/ast/resource.rb +103 -0
- data/spec/unit/parser/ast/resource_override.rb +0 -0
- data/spec/unit/parser/ast/resource_reference.rb +0 -0
- data/spec/unit/parser/ast/vardef.rb +0 -0
- data/spec/unit/parser/collector.rb +4 -4
- data/spec/unit/parser/compiler.rb +0 -0
- data/spec/unit/parser/functions/realize.rb +51 -0
- data/spec/unit/parser/functions/regsubst.rb +88 -0
- data/spec/unit/parser/functions/sprintf.rb +42 -0
- data/spec/unit/parser/functions/versioncmp.rb +29 -0
- data/spec/unit/parser/interpreter.rb +0 -0
- data/spec/unit/parser/lexer.rb +0 -0
- data/spec/unit/parser/parser.rb +0 -0
- data/spec/unit/parser/resource.rb +4 -0
- data/spec/unit/parser/resource/reference.rb +4 -0
- data/spec/unit/parser/scope.rb +14 -0
- data/spec/unit/parser/templatewrapper.rb +0 -0
- data/spec/unit/property.rb +0 -0
- data/spec/unit/property/list.rb +4 -0
- data/spec/unit/provider/augeas/augeas.rb +219 -92
- data/spec/unit/provider/confine.rb +0 -0
- data/spec/unit/provider/confine/exists.rb +0 -0
- data/spec/unit/provider/confine/false.rb +0 -0
- data/spec/unit/provider/confine/feature.rb +0 -0
- data/spec/unit/provider/confine/true.rb +0 -0
- data/spec/unit/provider/confine/variable.rb +0 -0
- data/spec/unit/provider/confine_collection.rb +0 -0
- data/spec/unit/provider/confiner.rb +0 -0
- data/spec/unit/provider/group/groupadd.rb +0 -0
- data/spec/unit/provider/group/ldap.rb +0 -0
- data/spec/unit/provider/ldap.rb +0 -0
- data/spec/unit/provider/macauthorization.rb +0 -0
- data/spec/unit/provider/mcx/mcxcontent.rb +0 -0
- data/spec/unit/provider/mount.rb +0 -0
- data/spec/unit/provider/mount/parsed.rb +1 -0
- data/spec/unit/provider/naginator.rb +58 -0
- data/spec/unit/provider/package/apt.rb +0 -0
- data/spec/unit/provider/package/dpkg.rb +0 -0
- data/spec/unit/provider/parsedfile.rb +95 -0
- data/spec/unit/provider/selboolean.rb +0 -0
- data/spec/unit/provider/selmodule.rb +0 -0
- data/spec/unit/provider/service/launchd.rb +9 -1
- data/spec/unit/provider/ssh_authorized_key/parsed.rb +63 -19
- data/spec/unit/provider/user/hpux.rb +0 -0
- data/spec/unit/provider/user/ldap.rb +0 -0
- data/spec/unit/provider/user/useradd.rb +0 -0
- data/spec/unit/provider/zfs/solaris.rb +0 -0
- data/spec/unit/provider/zone/solaris.rb +0 -0
- data/spec/unit/provider/zpool/solaris.rb +0 -0
- data/spec/unit/rails.rb +1 -0
- data/spec/unit/relationship.rb +0 -0
- data/spec/unit/reports.rb +0 -0
- data/spec/unit/resource_reference.rb +0 -0
- data/spec/unit/simple_graph.rb +0 -0
- data/spec/unit/{other/transaction.rb → transaction.rb} +16 -1
- data/spec/unit/transaction/change.rb +0 -0
- data/spec/unit/transaction/event.rb +0 -0
- data/spec/unit/transaction/report.rb +0 -0
- data/spec/unit/type.rb +0 -0
- data/spec/unit/type/computer.rb +0 -0
- data/spec/unit/type/exec.rb +0 -0
- data/spec/unit/type/file.rb +2 -0
- data/spec/unit/type/file/content.rb +30 -0
- data/spec/unit/type/file/ensure.rb +0 -0
- data/spec/unit/type/file/group.rb +0 -0
- data/spec/unit/type/file/owner.rb +0 -0
- data/spec/unit/type/file/selinux.rb +6 -0
- data/spec/unit/type/group.rb +3 -0
- data/spec/unit/type/macauthorization.rb +0 -0
- data/spec/unit/type/mcx.rb +0 -0
- data/spec/unit/type/mount.rb +0 -0
- data/spec/unit/type/nagios.rb +0 -0
- data/spec/unit/type/noop_metaparam.rb +1 -0
- data/spec/unit/type/package.rb +0 -0
- data/spec/unit/type/schedule.rb +0 -0
- data/spec/unit/type/selboolean.rb +0 -0
- data/spec/unit/type/selmodule.rb +0 -0
- data/spec/unit/type/service.rb +0 -0
- data/spec/unit/type/ssh_authorized_key.rb +31 -8
- data/spec/unit/type/tidy.rb +4 -0
- data/spec/unit/type/user.rb +17 -0
- data/spec/unit/type/zfs.rb +0 -0
- data/spec/unit/type/zone.rb +0 -0
- data/spec/unit/type/zpool.rb +0 -0
- data/spec/unit/util/autoload.rb +39 -0
- data/spec/unit/util/checksums.rb +0 -0
- data/spec/unit/util/constant_inflector.rb +0 -0
- data/spec/unit/util/file_locking.rb +0 -0
- data/spec/unit/util/filetype.rb +110 -0
- data/spec/unit/util/ldap/connection.rb +0 -0
- data/spec/unit/util/ldap/generator.rb +0 -0
- data/spec/unit/util/ldap/manager.rb +0 -0
- data/spec/unit/util/loadedfile.rb +0 -0
- data/spec/unit/util/log.rb +0 -0
- data/spec/unit/util/metric.rb +0 -0
- data/spec/unit/util/nagios_maker.rb +32 -34
- data/spec/unit/util/package.rb +21 -0
- data/spec/unit/util/posix.rb +0 -0
- data/spec/unit/util/resource_template.rb +0 -0
- data/spec/unit/util/settings.rb +0 -0
- data/spec/unit/util/storage.rb +0 -0
- data/spec/unit/util/tagging.rb +0 -0
- data/spec/unit/util/uri_helper.rb +0 -0
- data/spec/unit/util/warnings.rb +0 -0
- data/test/certmgr/ca.rb +0 -0
- data/test/certmgr/certmgr.rb +0 -0
- data/test/certmgr/inventory.rb +0 -0
- data/test/certmgr/support.rb +0 -0
- data/test/data/snippets/subclass_name_duplication.pp +0 -0
- data/test/executables/filebucket.rb +6 -3
- data/test/executables/puppetbin.rb +1 -1
- data/test/executables/puppetca.rb +0 -0
- data/test/executables/puppetd.rb +0 -0
- data/test/executables/puppetmasterd.rb +0 -0
- data/test/executables/puppetmodule.rb +0 -0
- data/test/language/ast.rb +0 -0
- data/test/language/ast/casestatement.rb +0 -0
- data/test/language/ast/resource.rb +0 -0
- data/test/language/ast/resource_reference.rb +0 -0
- data/test/language/ast/selector.rb +0 -0
- data/test/language/ast/variable.rb +0 -0
- data/test/language/functions.rb +0 -0
- data/test/language/parser.rb +0 -0
- data/test/language/resource.rb +0 -40
- data/test/language/scope.rb +0 -0
- data/test/language/snippets.rb +0 -0
- data/test/language/transportable.rb +0 -0
- data/test/lib/puppettest.rb +3 -0
- data/test/lib/puppettest/support/resources.rb +0 -0
- data/test/network/authconfig.rb +0 -0
- data/test/network/authorization.rb +0 -0
- data/test/network/authstore.rb +0 -0
- data/test/network/client/ca.rb +0 -0
- data/test/network/client/client.rb +0 -0
- data/test/network/client/dipper.rb +0 -0
- data/test/network/client/master.rb +0 -0
- data/test/network/client/resource.rb +0 -0
- data/test/network/client_request.rb +0 -0
- data/test/network/daemon.rb +0 -0
- data/test/network/handler/bucket.rb +0 -0
- data/test/network/handler/ca.rb +0 -0
- data/test/network/handler/fileserver.rb +0 -0
- data/test/network/handler/handler.rb +0 -0
- data/test/network/handler/master.rb +0 -0
- data/test/network/handler/report.rb +0 -0
- data/test/network/handler/resource.rb +0 -0
- data/test/network/handler/runner.rb +0 -0
- data/test/network/rights.rb +0 -0
- data/test/network/server/mongrel_test.rb +0 -0
- data/test/network/server/webrick.rb +0 -0
- data/test/network/xmlrpc/client.rb +0 -0
- data/test/network/xmlrpc/processor.rb +0 -0
- data/test/network/xmlrpc/server.rb +0 -0
- data/test/network/xmlrpc/webrick_servlet.rb +0 -0
- data/test/other/dsl.rb +0 -0
- data/test/other/events.rb +0 -0
- data/test/other/overrides.rb +0 -0
- data/test/other/provider.rb +0 -0
- data/test/other/puppet.rb +0 -0
- data/test/other/relationships.rb +0 -0
- data/test/other/report.rb +0 -0
- data/test/other/transactions.rb +0 -0
- data/test/puppet/conffiles.rb +0 -0
- data/test/puppet/defaults.rb +0 -0
- data/test/puppet/errortest.rb +0 -0
- data/test/puppet/tc_suidmanager.rb +0 -0
- data/test/rails/ast.rb +0 -0
- data/test/rails/configuration.rb +0 -0
- data/test/rails/host.rb +0 -0
- data/test/rails/rails.rb +0 -0
- data/test/rails/railsparameter.rb +0 -0
- data/test/rails/railsresource.rb +0 -0
- data/test/ral/manager/attributes.rb +0 -0
- data/test/ral/manager/instances.rb +0 -0
- data/test/ral/manager/manager.rb +0 -0
- data/test/ral/manager/provider.rb +0 -0
- data/test/ral/manager/type.rb +0 -3
- data/test/ral/providers/cron/crontab.rb +0 -0
- data/test/ral/providers/group.rb +0 -0
- data/test/ral/providers/host/netinfo.rb +0 -0
- data/test/ral/providers/host/parsed.rb +0 -0
- data/test/ral/providers/mailalias/aliases.rb +0 -0
- data/test/ral/providers/mount/netinfo.rb +0 -0
- data/test/ral/providers/nameservice.rb +0 -0
- data/test/ral/providers/package.rb +0 -0
- data/test/ral/providers/package/aptitude.rb +0 -0
- data/test/ral/providers/package/aptrpm.rb +0 -0
- data/test/ral/providers/parsedfile.rb +0 -0
- data/test/ral/providers/port/parsed.rb +0 -0
- data/test/ral/providers/provider.rb +0 -0
- data/test/ral/providers/service/base.rb +0 -0
- data/test/ral/providers/service/debian.rb +0 -0
- data/test/ral/providers/sshkey/parsed.rb +0 -0
- data/test/ral/providers/user.rb +0 -0
- data/test/ral/providers/user/useradd.rb +0 -0
- data/test/ral/type/basic.rb +0 -0
- data/test/ral/type/cron.rb +0 -0
- data/test/ral/type/exec.rb +0 -0
- data/test/ral/type/file.rb +0 -0
- data/test/ral/type/file/target.rb +0 -0
- data/test/ral/type/filebucket.rb +0 -0
- data/test/ral/type/fileignoresource.rb +0 -0
- data/test/ral/type/filesources.rb +0 -0
- data/test/ral/type/group.rb +0 -0
- data/test/ral/type/host.rb +0 -0
- data/test/ral/type/mailalias.rb +0 -0
- data/test/ral/type/parameter.rb +0 -0
- data/test/ral/type/port.rb +0 -0
- data/test/ral/type/property.rb +0 -0
- data/test/ral/type/resources.rb +0 -0
- data/test/ral/type/service.rb +0 -0
- data/test/ral/type/sshkey.rb +0 -0
- data/test/ral/type/tidy.rb +0 -0
- data/test/ral/type/user.rb +0 -0
- data/test/ral/type/yumrepo.rb +0 -0
- data/test/ral/type/zone.rb +0 -0
- data/test/test +0 -0
- data/test/util/autoload.rb +0 -0
- data/test/util/classgen.rb +0 -0
- data/test/util/execution.rb +0 -0
- data/test/util/features.rb +0 -0
- data/test/util/fileparsing.rb +0 -0
- data/test/util/inifile.rb +0 -0
- data/test/util/instance_loader.rb +0 -0
- data/test/util/log.rb +0 -0
- data/test/util/metrics.rb +0 -0
- data/test/util/package.rb +0 -0
- data/test/util/pidlock.rb +0 -0
- data/test/util/settings.rb +0 -0
- data/test/util/storage.rb +0 -0
- data/test/util/subclass_loader.rb +0 -0
- data/test/util/utiltest.rb +0 -0
- metadata +981 -968
- data/test/util/filetype.rb +0 -137
@@ -5,4 +5,22 @@ class Puppet::Rails::ResourceTag < ActiveRecord::Base
|
|
5
5
|
def to_label
|
6
6
|
"#{self.puppet_tag.name}"
|
7
7
|
end
|
8
|
+
|
9
|
+
# returns an array of hash containing tags of resource
|
10
|
+
def self.find_all_tags_from_resource(db_resource)
|
11
|
+
tags = db_resource.connection.select_all("SELECT t.id, t.resource_id, p.name FROM resource_tags as t INNER JOIN puppet_tags as p ON t.puppet_tag_id=p.id WHERE t.resource_id=%s" % db_resource.id)
|
12
|
+
tags.each do |val|
|
13
|
+
val['resource_id'] = Integer(val['resource_id'])
|
14
|
+
end
|
15
|
+
tags
|
16
|
+
end
|
17
|
+
|
18
|
+
# returns an array of hash containing tags of a host
|
19
|
+
def self.find_all_tags_from_host(db_host)
|
20
|
+
tags = db_host.connection.select_all("SELECT t.id, t.resource_id, p.name FROM resource_tags as t INNER JOIN resources r ON t.resource_id=r.id INNER JOIN puppet_tags as p ON t.puppet_tag_id=p.id WHERE r.host_id=%s" % db_host.id)
|
21
|
+
tags.each do |val|
|
22
|
+
val['resource_id'] = Integer(val['resource_id'])
|
23
|
+
end
|
24
|
+
tags
|
25
|
+
end
|
8
26
|
end
|
data/lib/puppet/reports.rb
CHANGED
File without changes
|
File without changes
|
data/lib/puppet/transaction.rb
CHANGED
@@ -480,7 +480,7 @@ class Transaction
|
|
480
480
|
@catalog.vertices.each do |resource|
|
481
481
|
if provider = resource.provider and provider.class.respond_to?(:prefetch)
|
482
482
|
prefetchers[provider.class] ||= {}
|
483
|
-
prefetchers[provider.class][resource.
|
483
|
+
prefetchers[provider.class][resource.name] = resource
|
484
484
|
end
|
485
485
|
end
|
486
486
|
|
data/lib/puppet/type.rb
CHANGED
@@ -10,6 +10,7 @@ require 'puppet/util/errors'
|
|
10
10
|
require 'puppet/util/log_paths'
|
11
11
|
require 'puppet/util/logging'
|
12
12
|
require 'puppet/resource_reference'
|
13
|
+
require 'puppet/file_collection/lookup'
|
13
14
|
|
14
15
|
# see the bottom of the file for the rest of the inclusions
|
15
16
|
|
@@ -19,6 +20,7 @@ class Type
|
|
19
20
|
include Puppet::Util::Errors
|
20
21
|
include Puppet::Util::LogPaths
|
21
22
|
include Puppet::Util::Logging
|
23
|
+
include Puppet::FileCollection::Lookup
|
22
24
|
|
23
25
|
###############################
|
24
26
|
# Code related to resource type attributes.
|
@@ -822,10 +824,6 @@ class Type
|
|
822
824
|
end
|
823
825
|
@evalcount += 1
|
824
826
|
|
825
|
-
if p = self.provider and p.respond_to?(:prefetch)
|
826
|
-
p.prefetch
|
827
|
-
end
|
828
|
-
|
829
827
|
# this only operates on properties, not properties + children
|
830
828
|
# it's important that we call retrieve() on the type instance,
|
831
829
|
# not directly on the property, because it allows the type to override
|
@@ -2139,8 +2137,6 @@ class Type
|
|
2139
2137
|
# In naming methods, I have tried to consistently name the method so
|
2140
2138
|
# that it is clear whether it operates on all attributes (thus has 'attr' in
|
2141
2139
|
# the method name, or whether it operates on a specific type of attributes.
|
2142
|
-
attr_accessor :file, :line
|
2143
|
-
|
2144
2140
|
attr_writer :title
|
2145
2141
|
attr_writer :noop
|
2146
2142
|
|
data/lib/puppet/type/augeas.rb
CHANGED
@@ -19,10 +19,10 @@
|
|
19
19
|
|
20
20
|
Puppet::Type.newtype(:augeas) do
|
21
21
|
include Puppet::Util
|
22
|
-
|
22
|
+
|
23
23
|
feature :parse_commands, "Parse the command string"
|
24
24
|
feature :need_to_run?, "If the command should run"
|
25
|
-
feature :execute_changes, "Actually make the changes"
|
25
|
+
feature :execute_changes, "Actually make the changes"
|
26
26
|
|
27
27
|
@doc = "Apply the changes (single or array of changes) to the filesystem
|
28
28
|
via the augeas tool.
|
@@ -59,7 +59,7 @@ Puppet::Type.newtype(:augeas) do
|
|
59
59
|
|
60
60
|
newparam (:context) do
|
61
61
|
desc "Optional context path. This value is pre-pended to the paths of all changes"
|
62
|
-
defaultto ""
|
62
|
+
defaultto ""
|
63
63
|
end
|
64
64
|
|
65
65
|
newparam (:onlyif) do
|
@@ -81,7 +81,7 @@ Puppet::Type.newtype(:augeas) do
|
|
81
81
|
AN_ARRAY is in the form ['a string', 'another']"
|
82
82
|
defaultto ""
|
83
83
|
end
|
84
|
-
|
84
|
+
|
85
85
|
|
86
86
|
newparam(:changes) do
|
87
87
|
desc "The changes which should be applied to the filesystem. This
|
@@ -92,12 +92,13 @@ Puppet::Type.newtype(:augeas) do
|
|
92
92
|
rm [PATH] Removes the node at location PATH
|
93
93
|
remove [PATH] Synonym for rm
|
94
94
|
clear [PATH] Keeps the node at PATH, but removes the value.
|
95
|
-
ins [
|
96
|
-
|
95
|
+
ins [LABEL] [WHERE] [PATH]
|
96
|
+
Inserts an empty node LABEL either [WHERE={before|after}] PATH.
|
97
|
+
insert [LABEL] [WHERE] [PATH]
|
98
|
+
Synonym for ins
|
99
|
+
If the parameter 'context' is set that value is prepended to PATH"
|
97
100
|
|
98
|
-
|
99
|
-
|
100
|
-
munge do |value|
|
101
|
+
munge do |value|
|
101
102
|
provider.parse_commands(value)
|
102
103
|
end
|
103
104
|
end
|
@@ -113,6 +114,13 @@ Puppet::Type.newtype(:augeas) do
|
|
113
114
|
defaultto ""
|
114
115
|
end
|
115
116
|
|
117
|
+
newparam(:force) do
|
118
|
+
desc "Optional command to force the augeas type to execute even if it thinks changes
|
119
|
+
will not be made. This does not overide the only setting. If onlyif is set, then the
|
120
|
+
foce setting will not override that result"
|
121
|
+
|
122
|
+
defaultto false
|
123
|
+
end
|
116
124
|
|
117
125
|
newparam(:type_check) do
|
118
126
|
desc "Set to true if augeas should perform typechecking. Optional, defaults to false"
|
@@ -120,7 +128,7 @@ Puppet::Type.newtype(:augeas) do
|
|
120
128
|
|
121
129
|
defaultto :false
|
122
130
|
end
|
123
|
-
|
131
|
+
|
124
132
|
# This is the acutal meat of the code. It forces
|
125
133
|
# augeas to be run and fails or not based on the augeas return
|
126
134
|
# code.
|
@@ -129,12 +137,12 @@ Puppet::Type.newtype(:augeas) do
|
|
129
137
|
desc "The expected return code from the augeas command. Should not be set"
|
130
138
|
|
131
139
|
defaultto 0
|
132
|
-
|
140
|
+
|
133
141
|
# Make output a bit prettier
|
134
142
|
def change_to_s(currentvalue, newvalue)
|
135
143
|
return "executed successfully"
|
136
|
-
end
|
137
|
-
|
144
|
+
end
|
145
|
+
|
138
146
|
# if the onlyif resource is provided, then the value is parsed.
|
139
147
|
# a return value of 0 will stop exection becuase it matches the
|
140
148
|
# default value.
|
@@ -144,12 +152,12 @@ Puppet::Type.newtype(:augeas) do
|
|
144
152
|
else
|
145
153
|
0
|
146
154
|
end
|
147
|
-
end
|
155
|
+
end
|
148
156
|
|
149
157
|
# Actually execute the command.
|
150
158
|
def sync
|
151
159
|
@resource.provider.execute_changes()
|
152
160
|
end
|
153
|
-
end
|
161
|
+
end
|
154
162
|
|
155
163
|
end
|
data/lib/puppet/type/cron.rb
CHANGED
File without changes
|
data/lib/puppet/type/exec.rb
CHANGED
File without changes
|
@@ -11,7 +11,13 @@ Puppet::Type.type(:file).newproperty(:checksum) do
|
|
11
11
|
like Tripwire without managing the file contents in any way. You can
|
12
12
|
specify that a file's checksum should be monitored and then subscribe to
|
13
13
|
the file from another object and receive events to signify
|
14
|
-
checksum changes, for instance.
|
14
|
+
checksum changes, for instance.
|
15
|
+
|
16
|
+
There are a number of checksum types available including MD5 hashing (and
|
17
|
+
an md5lite variation that only hashes the first 500 characters of the
|
18
|
+
file.
|
19
|
+
|
20
|
+
The default checksum parameter, if checksums are enabled, is md5."
|
15
21
|
|
16
22
|
@event = :file_changed
|
17
23
|
|
@@ -37,11 +43,6 @@ Puppet::Type.type(:file).newproperty(:checksum) do
|
|
37
43
|
handlesum()
|
38
44
|
end
|
39
45
|
|
40
|
-
newvalue(:nosum) do
|
41
|
-
# nothing
|
42
|
-
:nochange
|
43
|
-
end
|
44
|
-
|
45
46
|
# If they pass us a sum type, behave normally, but if they pass
|
46
47
|
# us a sum type + sum, stick the sum in the cache.
|
47
48
|
munge do |value|
|
@@ -129,35 +130,6 @@ Puppet::Type.type(:file).newproperty(:checksum) do
|
|
129
130
|
cache(checktype())
|
130
131
|
end
|
131
132
|
|
132
|
-
# Retrieve the cached sum
|
133
|
-
def getcachedsum
|
134
|
-
hash = nil
|
135
|
-
unless hash = @resource.cached(:checksums)
|
136
|
-
hash = {}
|
137
|
-
@resource.cache(:checksums, hash)
|
138
|
-
end
|
139
|
-
|
140
|
-
sumtype = self.should
|
141
|
-
|
142
|
-
if hash.include?(sumtype)
|
143
|
-
#self.notice "Found checksum %s for %s" %
|
144
|
-
# [hash[sumtype] ,@resource[:path]]
|
145
|
-
sum = hash[sumtype]
|
146
|
-
|
147
|
-
unless sum =~ /^\{\w+\}/
|
148
|
-
sum = "{%s}%s" % [sumtype, sum]
|
149
|
-
end
|
150
|
-
return sum
|
151
|
-
elsif hash.empty?
|
152
|
-
#self.notice "Could not find sum of type %s" % sumtype
|
153
|
-
return :nosum
|
154
|
-
else
|
155
|
-
#self.notice "Found checksum for %s but not of type %s" %
|
156
|
-
# [@resource[:path],sumtype]
|
157
|
-
return :nosum
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
133
|
# Calculate the sum from disk.
|
162
134
|
def getsum(checktype, file = nil)
|
163
135
|
sum = ""
|
@@ -22,14 +22,17 @@ module Puppet
|
|
22
22
|
This attribute is especially useful when used with
|
23
23
|
`PuppetTemplating templating`:trac:."
|
24
24
|
|
25
|
-
def
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
25
|
+
def string_as_checksum(string)
|
26
|
+
return "absent" if string == :absent
|
27
|
+
"{md5}" + Digest::MD5.hexdigest(string)
|
28
|
+
end
|
29
|
+
|
30
|
+
def should_to_s(should)
|
31
|
+
string_as_checksum(should)
|
32
|
+
end
|
33
|
+
|
34
|
+
def is_to_s(is)
|
35
|
+
string_as_checksum(is)
|
33
36
|
end
|
34
37
|
|
35
38
|
# Override this method to provide diffs if asked for.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -44,6 +44,14 @@ module Puppet
|
|
44
44
|
return property_default
|
45
45
|
end
|
46
46
|
|
47
|
+
def insync?(value)
|
48
|
+
if not selinux_support?
|
49
|
+
debug("SELinux bindings not found. Ignoring parameter.")
|
50
|
+
return true
|
51
|
+
end
|
52
|
+
super
|
53
|
+
end
|
54
|
+
|
47
55
|
def sync
|
48
56
|
self.set_selinux_context(@resource[:path], @should, name)
|
49
57
|
return :file_changed
|
File without changes
|
File without changes
|
File without changes
|
data/lib/puppet/type/group.rb
CHANGED
File without changes
|
data/lib/puppet/type/host.rb
CHANGED
File without changes
|
File without changes
|
data/lib/puppet/type/maillist.rb
CHANGED
File without changes
|
data/lib/puppet/type/mount.rb
CHANGED
File without changes
|
data/lib/puppet/type/port.rb
CHANGED
File without changes
|
data/lib/puppet/type/schedule.rb
CHANGED
File without changes
|
@@ -31,6 +31,20 @@ module Puppet
|
|
31
31
|
|
32
32
|
newproperty(:target) do
|
33
33
|
desc "The file in which to store the SSH key."
|
34
|
+
|
35
|
+
defaultto :absent
|
36
|
+
|
37
|
+
def should
|
38
|
+
if defined? @should and @should[0] != :absent
|
39
|
+
return super
|
40
|
+
end
|
41
|
+
|
42
|
+
if user = resource[:user]
|
43
|
+
return File.expand_path("~%s/.ssh/authorized_keys" % user)
|
44
|
+
end
|
45
|
+
|
46
|
+
return nil
|
47
|
+
end
|
34
48
|
end
|
35
49
|
|
36
50
|
newproperty(:options, :array_matching => :all) do
|
data/lib/puppet/type/sshkey.rb
CHANGED
File without changes
|
data/lib/puppet/type/tidy.rb
CHANGED
File without changes
|
data/lib/puppet/type/user.rb
CHANGED
@@ -100,6 +100,8 @@ module Puppet
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def insync?(is)
|
103
|
+
return true unless self.should
|
104
|
+
|
103
105
|
# We know the 'is' is a number, so we need to convert the 'should' to a number,
|
104
106
|
# too.
|
105
107
|
@should.each do |value|
|
@@ -142,6 +144,10 @@ module Puppet
|
|
142
144
|
newproperty(:password, :required_features => :manages_passwords) do
|
143
145
|
desc "The user's password, in whatever encrypted format the local machine requires. Be sure to enclose any value that includes a dollar sign ($) in single quotes (\')."
|
144
146
|
|
147
|
+
validate do |value|
|
148
|
+
raise ArgumentError, "Passwords cannot include ':'" if value.is_a?(String) and value.include?(":")
|
149
|
+
end
|
150
|
+
|
145
151
|
def change_to_s(currentvalue, newvalue)
|
146
152
|
if currentvalue == :absent
|
147
153
|
return "created password"
|
data/lib/puppet/type/yumrepo.rb
CHANGED
data/lib/puppet/type/zfs.rb
CHANGED
File without changes
|
data/lib/puppet/type/zpool.rb
CHANGED
File without changes
|
data/lib/puppet/util/autoload.rb
CHANGED
@@ -78,7 +78,7 @@ class Puppet::Util::Autoload
|
|
78
78
|
name = symbolize(name)
|
79
79
|
loaded name, file
|
80
80
|
return true
|
81
|
-
rescue
|
81
|
+
rescue Exception => detail
|
82
82
|
# I have no idea what's going on here, but different versions
|
83
83
|
# of ruby are raising different errors on missing files.
|
84
84
|
unless detail.to_s =~ /^no such file/i
|
@@ -115,7 +115,7 @@ class Puppet::Util::Autoload
|
|
115
115
|
begin
|
116
116
|
Kernel.require file
|
117
117
|
loaded(name, file)
|
118
|
-
rescue => detail
|
118
|
+
rescue Exception => detail
|
119
119
|
if Puppet[:trace]
|
120
120
|
puts detail.backtrace
|
121
121
|
end
|
data/lib/puppet/util/filetype.rb
CHANGED
@@ -72,11 +72,6 @@ class Puppet::Util::FileType
|
|
72
72
|
@filetypes[type]
|
73
73
|
end
|
74
74
|
|
75
|
-
# Back the file up before replacing it.
|
76
|
-
def backup
|
77
|
-
bucket.backup(@path) if FileTest.exists?(@path)
|
78
|
-
end
|
79
|
-
|
80
75
|
# Pick or create a filebucket to use.
|
81
76
|
def bucket
|
82
77
|
filebucket = Puppet::Type.type(:filebucket)
|
@@ -90,9 +85,14 @@ class Puppet::Util::FileType
|
|
90
85
|
|
91
86
|
# Operate on plain files.
|
92
87
|
newfiletype(:flat) do
|
88
|
+
# Back the file up before replacing it.
|
89
|
+
def backup
|
90
|
+
bucket.backup(@path) if File.exists?(@path)
|
91
|
+
end
|
92
|
+
|
93
93
|
# Read the file.
|
94
94
|
def read
|
95
|
-
if File.
|
95
|
+
if File.exist?(@path)
|
96
96
|
File.read(@path)
|
97
97
|
else
|
98
98
|
return nil
|
@@ -101,14 +101,13 @@ class Puppet::Util::FileType
|
|
101
101
|
|
102
102
|
# Remove the file.
|
103
103
|
def remove
|
104
|
-
if File.
|
104
|
+
if File.exist?(@path)
|
105
105
|
File.unlink(@path)
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
109
|
# Overwrite the file.
|
110
110
|
def write(text)
|
111
|
-
backup()
|
112
111
|
require "tempfile"
|
113
112
|
tf = Tempfile.new("puppet")
|
114
113
|
tf.print text; tf.flush
|
@@ -250,92 +249,4 @@ class Puppet::Util::FileType
|
|
250
249
|
output_file.delete
|
251
250
|
end
|
252
251
|
end
|
253
|
-
|
254
|
-
# Treat netinfo tables as a single file, just for simplicity of certain
|
255
|
-
# types
|
256
|
-
newfiletype(:netinfo) do
|
257
|
-
class << self
|
258
|
-
attr_accessor :format
|
259
|
-
end
|
260
|
-
def read
|
261
|
-
%x{nidump -r /#{@path} /}
|
262
|
-
end
|
263
|
-
|
264
|
-
# This really only makes sense for cron tabs.
|
265
|
-
def remove
|
266
|
-
%x{nireport / /#{@path} name}.split("\n").each do |name|
|
267
|
-
newname = name.gsub(/\//, '\/').sub(/\s+$/, '')
|
268
|
-
output = %x{niutil -destroy / '/#{@path}/#{newname}'}
|
269
|
-
|
270
|
-
unless $? == 0
|
271
|
-
raise Puppet::Error, "Could not remove %s from %s" %
|
272
|
-
[name, @path]
|
273
|
-
end
|
274
|
-
end
|
275
|
-
end
|
276
|
-
|
277
|
-
# Convert our table to an array of hashes. This only works for
|
278
|
-
# handling one table at a time.
|
279
|
-
def to_array(text = nil)
|
280
|
-
unless text
|
281
|
-
text = read
|
282
|
-
end
|
283
|
-
|
284
|
-
hash = nil
|
285
|
-
|
286
|
-
# Initialize it with the first record
|
287
|
-
records = []
|
288
|
-
text.split("\n").each do |line|
|
289
|
-
next if line =~ /^[{}]$/ # Skip the wrapping lines
|
290
|
-
next if line =~ /"name" = \( "#{@path}" \)/ # Skip the table name
|
291
|
-
next if line =~ /CHILDREN = \(/ # Skip this header
|
292
|
-
next if line =~ /^ \)/ # and its closer
|
293
|
-
|
294
|
-
# Now we should have nothing but records, wrapped in braces
|
295
|
-
|
296
|
-
case line
|
297
|
-
when /^\s+\{/: hash = {}
|
298
|
-
when /^\s+\}/: records << hash
|
299
|
-
when /\s+"(\w+)" = \( (.+) \)/
|
300
|
-
field = $1
|
301
|
-
values = $2
|
302
|
-
|
303
|
-
# Always use an array
|
304
|
-
hash[field] = []
|
305
|
-
|
306
|
-
values.split(/, /).each do |value|
|
307
|
-
if value =~ /^"(.*)"$/
|
308
|
-
hash[field] << $1
|
309
|
-
else
|
310
|
-
raise ArgumentError, "Could not match value %s" % value
|
311
|
-
end
|
312
|
-
end
|
313
|
-
else
|
314
|
-
raise ArgumentError, "Could not match line %s" % line
|
315
|
-
end
|
316
|
-
end
|
317
|
-
|
318
|
-
records
|
319
|
-
end
|
320
|
-
|
321
|
-
def write(text)
|
322
|
-
text.gsub!(/^#.*\n/,'')
|
323
|
-
text.gsub!(/^$/,'')
|
324
|
-
if text == "" or text == "\n"
|
325
|
-
self.remove
|
326
|
-
return
|
327
|
-
end
|
328
|
-
unless format = self.class.format
|
329
|
-
raise Puppe::DevError, "You must define the NetInfo format to inport"
|
330
|
-
end
|
331
|
-
IO.popen("niload -d #{format} . 1>/dev/null 2>/dev/null", "w") { |p|
|
332
|
-
p.print text
|
333
|
-
}
|
334
|
-
|
335
|
-
unless $? == 0
|
336
|
-
raise ArgumentError, "Failed to write %s" % @path
|
337
|
-
end
|
338
|
-
end
|
339
|
-
end
|
340
252
|
end
|
341
|
-
|