From f13f3cfac7c719aa4b7025fe7d427df638fc5cc2 Mon Sep 17 00:00:00 2001 From: Nan Liu Date: Thu, 3 May 2012 15:44:17 -0700 Subject: [PATCH] (#11966) Change apt update to apt_update. Based on code review change exec from apt update to apt_update. --- manifests/builddep.pp | 2 +- manifests/init.pp | 8 ++++---- manifests/ppa.pp | 2 +- manifests/source.pp | 2 +- manifests/update.pp | 2 +- spec/classes/apt_spec.rb | 8 ++++---- spec/defines/builddep_spec.rb | 2 +- spec/defines/ppa_spec.rb | 4 ++-- spec/defines/source_spec.rb | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/manifests/builddep.pp b/manifests/builddep.pp index 35d8d30..f7537fb 100644 --- a/manifests/builddep.pp +++ b/manifests/builddep.pp @@ -7,6 +7,6 @@ define apt::builddep() { exec { "apt-builddep-${name}": command => "/usr/bin/apt-get -y --force-yes build-dep ${name}", - notify => Exec['apt update'], + notify => Exec['apt_update'], } } diff --git a/manifests/init.pp b/manifests/init.pp index ce88c3b..53e25dc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -43,7 +43,7 @@ class apt( } if $always_apt_update == true { - Exec <| title=='apt update' |> { + Exec <| title=='apt_update' |> { refreshonly => false, } } @@ -60,7 +60,7 @@ class apt( group => root, mode => '0644', content => $sources_list_content, - notify => Exec['apt update'], + notify => Exec['apt_update'], } file { 'sources.list.d': @@ -70,7 +70,7 @@ class apt( group => root, purge => $purge_sources_list_d, recurse => $purge_sources_list_d, - notify => Exec['apt update'], + notify => Exec['apt_update'], } case $disable_keys { @@ -95,7 +95,7 @@ class apt( file { 'configure-apt-proxy': path => "${apt_conf_d}/proxy", content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";", - notify => Exec['apt update'], + notify => Exec['apt_update'], } } } diff --git a/manifests/ppa.pp b/manifests/ppa.pp index ca7f620..c0dfaa0 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -23,7 +23,7 @@ define apt::ppa( exec { "add-apt-repository-${name}": command => "/usr/bin/add-apt-repository ${name}", creates => "${sources_list_d}/${sources_list_d_filename}", - notify => Exec['apt update'], + notify => Exec['apt_update'], } file { "${sources_list_d}/${sources_list_d_filename}": diff --git a/manifests/source.pp b/manifests/source.pp index e9eb654..cbf2fd4 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -32,7 +32,7 @@ define apt::source( group => root, mode => '0644', content => template("${module_name}/source.list.erb"), - notify => Exec['apt update'], + notify => Exec['apt_update'], } if ($pin != false) and ($ensure == 'present') { diff --git a/manifests/update.pp b/manifests/update.pp index b079c1f..016df7d 100644 --- a/manifests/update.pp +++ b/manifests/update.pp @@ -1,7 +1,7 @@ class apt::update { include apt::params - exec { 'apt update': + exec { 'apt_update': command => "${apt::params::provider} update", refreshonly => true, } diff --git a/spec/classes/apt_spec.rb b/spec/classes/apt_spec.rb index 4d44bcc..ac626d2 100644 --- a/spec/classes/apt_spec.rb +++ b/spec/classes/apt_spec.rb @@ -73,7 +73,7 @@ describe 'apt', :type => :class do 'group' => "root", 'purge' => true, 'recurse' => true, - 'notify' => 'Exec[apt update]' + 'notify' => 'Exec[apt_update]' }) else should create_file("sources.list.d").with({ @@ -83,13 +83,13 @@ describe 'apt', :type => :class do 'group' => "root", 'purge' => false, 'recurse' => false, - 'notify' => 'Exec[apt update]' + 'notify' => 'Exec[apt_update]' }) end } it { - should contain_exec("apt update").with({ + should contain_exec("apt_update").with({ 'command' => "/usr/bin/apt-get update", 'refreshonly' => refresh_only_apt_update }) @@ -119,7 +119,7 @@ describe 'apt', :type => :class do should contain_file('configure-apt-proxy').with( 'path' => '/etc/apt/apt.conf.d/proxy', 'content' => "Acquire::http::Proxy \"http://#{param_hash[:proxy_host]}:#{param_hash[:proxy_port]}\";", - 'notify' => "Exec[apt update]" + 'notify' => "Exec[apt_update]" ) else should_not contain_file('configure_apt_proxy') diff --git a/spec/defines/builddep_spec.rb b/spec/defines/builddep_spec.rb index 39ee988..940c60c 100644 --- a/spec/defines/builddep_spec.rb +++ b/spec/defines/builddep_spec.rb @@ -6,7 +6,7 @@ describe 'apt::builddep', :type => :define do describe "should succeed with a Class['apt']" do let(:pre_condition) { 'class {"apt": } ' } - it { should contain_exec("apt update").with({ + it { should contain_exec("apt_update").with({ 'command' => "/usr/bin/apt-get update", 'refreshonly' => true }) diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index e353489..18c1a4f 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -18,7 +18,7 @@ describe 'apt::ppa', :type => :define do t.sub(/^ppa:/,'').gsub('/','-') << "-" << "#{release}.list" end - it { should contain_exec("apt update").with( + it { should contain_exec("apt_update").with( 'command' => '/usr/bin/apt-get update', 'refreshonly' => true ) @@ -26,7 +26,7 @@ describe 'apt::ppa', :type => :define do it { should contain_exec("add-apt-repository-#{t}").with( 'command' => "/usr/bin/add-apt-repository #{t}", - 'notify' => "Exec[apt update]", + 'notify' => "Exec[apt_update]", 'creates' => "/etc/apt/sources.list.d/#{filename}" ) } diff --git a/spec/defines/source_spec.rb b/spec/defines/source_spec.rb index a6c5e5f..110e8c2 100644 --- a/spec/defines/source_spec.rb +++ b/spec/defines/source_spec.rb @@ -97,7 +97,7 @@ describe 'apt::source', :type => :define do } it { - should contain_exec("apt update").with({ + should contain_exec("apt_update").with({ "command" => "/usr/bin/apt-get update", "refreshonly" => true }) -- 2.32.3