diff options
author | Daniil Baturin <daniil.baturin@vyatta.com> | 2011-11-15 23:49:00 +0700 |
---|---|---|
committer | Daniil Baturin <daniil.baturin@vyatta.com> | 2011-11-15 23:49:00 +0700 |
commit | 6175bcb25ab281390023561ef15b96a44b2dffbb (patch) | |
tree | 8b07979f0b0e56fef90b955cec59aa0b908c8609 | |
parent | 9fd90ff1bf6ce9f8044fab99ecb70f8506e3a116 (diff) | |
parent | 29eb9a1f7ecb1af6167093163b2bf9de48a7cf08 (diff) | |
download | vyatta-op-6175bcb25ab281390023561ef15b96a44b2dffbb.tar.gz vyatta-op-6175bcb25ab281390023561ef15b96a44b2dffbb.zip |
Merge branch 'oxnard' of git.vyatta.com:/git/vyatta-op into oxnard
-rw-r--r-- | debian/changelog | 39 | ||||
-rw-r--r-- | etc/shell/level/users/allowed-op.in | 1 | ||||
-rw-r--r-- | scripts/dhcpv6-client-show-leases.pl | 10 | ||||
-rw-r--r-- | scripts/rename-image.pl | 21 | ||||
-rwxr-xr-x | scripts/vyatta-op-dns-forwarding.pl | 51 | ||||
-rwxr-xr-x | scripts/vyatta-reboot.pl | 2 | ||||
-rw-r--r-- | templates/install/node.def | 2 | ||||
-rw-r--r-- | templates/show/system/boot-messages/commit/node.def | 2 |
8 files changed, 104 insertions, 24 deletions
diff --git a/debian/changelog b/debian/changelog index 24ecca4..fe8e61e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,42 @@ +vyatta-op (0.13.214) unstable; urgency=low + + * :Fixing bug 4086, added support for showing domain overrides + + -- Gaurav Sinha <gaurav.sinha@vyatta.com> Wed, 09 Nov 2011 16:38:31 -0800 + +vyatta-op (0.13.213) unstable; urgency=low + + * Fix perlcritic warning about bareword file handle + * cleanup rename-image + + -- Stephen Hemminger <shemminger@vyatta.com> Wed, 09 Nov 2011 08:19:04 -0800 + +vyatta-op (0.13.212) unstable; urgency=low + + * Remove accidental commit of 'show system boot-messages commit' + command, this was part of a mockup for a proposed bugfix and I + didn't intend to commit it + + -- John Southworth <john.southworth@vyatta.com> Mon, 07 Nov 2011 18:05:50 -0600 + +vyatta-op (0.13.211) unstable; urgency=low + + * Fix install help text + + -- John Southworth <john.southworth@vyatta.com> Tue, 01 Nov 2011 13:40:03 -0500 + +vyatta-op (0.13.210) unstable; urgency=low + + * Bugfix 7603: add reset top level to allowed list for operator users + + -- John Southworth <john.southworth@vyatta.com> Tue, 01 Nov 2011 13:22:55 -0500 + +vyatta-op (0.13.209) unstable; urgency=low + + * Wait for user to hit enter before continuing with a reboot + + -- John Southworth <john.southworth@vyatta.com> Tue, 01 Nov 2011 11:31:53 -0500 + vyatta-op (0.13.208) unstable; urgency=low * Create new ping command with the following semantics diff --git a/etc/shell/level/users/allowed-op.in b/etc/shell/level/users/allowed-op.in index 725f72c..1976904 100644 --- a/etc/shell/level/users/allowed-op.in +++ b/etc/shell/level/users/allowed-op.in @@ -6,6 +6,7 @@ exit force monitor ping +reset release renew set diff --git a/scripts/dhcpv6-client-show-leases.pl b/scripts/dhcpv6-client-show-leases.pl index 546668c..44be689 100644 --- a/scripts/dhcpv6-client-show-leases.pl +++ b/scripts/dhcpv6-client-show-leases.pl @@ -74,13 +74,11 @@ my %ghash = (); foreach my $lease_filename (@lease_files) { my @lines=(); - if (!open(LEASE_FILE, "</var/lib/dhcp3/$lease_filename")) { - printf("Can't open lease file for reading: $lease_filename\n"); - exit 1; - } + open(my $f, '<', "/var/lib/dhcp3/$lease_filename") + or die "Can't open lease file for reading: $lease_filename\n"; - @lines = <LEASE_FILE>; - close(LEASE_FILE); + @lines = <$f>; + close $f; chomp @lines; my $level = 0; diff --git a/scripts/rename-image.pl b/scripts/rename-image.pl index 8632334..be30967 100644 --- a/scripts/rename-image.pl +++ b/scripts/rename-image.pl @@ -24,6 +24,8 @@ use strict; use warnings; use Getopt::Long; use File::Temp qw/ tempfile tempdir /; +use File::Copy; +use Sys::Syslog qw/:standard :macros/; my $UNION_BOOT = '/live/image/boot'; my $XEN_DEFAULT_IMAGE = "$UNION_BOOT/%%default_image"; @@ -99,16 +101,14 @@ my $tmpfh; my $tmpfilename; ($tmpfh, $tmpfilename) = tempfile(); -if (!open (GRUBFH, "<${image_path}/grub/grub.cfg")) { - printf("Can't open grub file.\n"); - exit 1; -} +open (my $grubfh, '<', "${image_path}/grub/grub.cfg") + or die "Can't open grub file.\n"; # This is sensitive to the format of menu entries and boot paths # in the grub config file. # my $line; -while ($line = <GRUBFH>) { +while ($line = <$grubfh>) { $line =~ s/\/boot\/$old_name/\/boot\/$new_name/g; $line =~ s/Vyatta $old_name/Vyatta $new_name/; $line =~ s/Vyatta image $old_name/Vyatta image $new_name/; @@ -117,13 +117,14 @@ while ($line = <GRUBFH>) { } close($tmpfh); -close(GRUBFH); +close($grubfh); -system("mv $image_path/$old_name $image_path/$new_name"); -system("cp $tmpfilename $image_path/grub/grub.cfg"); +mv("$image_path/$old_name", "$image_path/$new_name") + or die "rename $old_name to $new_name failed: $!\n"; +cp($tmpfilename, "$image_path/grub/grub.cfg") + or die "copy $tmpfilename to grub.cfg failed: $!\n"; -system("logger -p local3.warning -t 'SystemImage' 'System image $old_name has been renamed $new_name'"); +syslog("warning", "System image $old_name has been renamed $new_name"); printf("Done.\n"); - diff --git a/scripts/vyatta-op-dns-forwarding.pl b/scripts/vyatta-op-dns-forwarding.pl index 99b5eac..a20cf45 100755 --- a/scripts/vyatta-op-dns-forwarding.pl +++ b/scripts/vyatta-op-dns-forwarding.pl @@ -67,8 +67,24 @@ sub get_nameserver_stats { $show_stats_output .= "Nameserver statistics\n"; $show_stats_output .= "---------------------\n"; - my @grepped_lines = `grep ': server' $dnsmasq_log`; + #To show overridden domain servers seperately, we need to compare IPs + #configured for the domain overrides in the config with the stats. + + my $vyatta_config = new Vyatta::Config; + $vyatta_config->setLevel("service dns forwarding"); + + my @domains = $vyatta_config->listOrigNodes("domain"); + my @domain_servers_list; + #build a list of servers that are overriding global nameservers + if (@domains) { + foreach my $domain (@domains) { + push(@domain_servers_list, $vyatta_config->returnOrigValue("domain $domain server")); + } + } + my $found_overrides = 0; + my $show_stats_overrides; + my @grepped_lines = `grep ': server' $dnsmasq_log`; foreach my $lines (@grepped_lines) { my @each_line = split(/\s+/, $lines); my $nameserver_word = $each_line[5]; @@ -79,9 +95,17 @@ sub get_nameserver_stats { my $queries_sent = $queries_sent_split[0]; my $queries_retried_failed = $each_line[12]; - $show_stats_output .= "Server: $nameserver\nQueries sent: $queries_sent\nQueries retried or failed: $queries_retried_failed\n\n"; - + if (grep {$_ eq $nameserver}@domain_servers_list) { + if (!$found_overrides) { + $found_overrides = 1; + $show_stats_overrides .= "\nDomain Override Servers\n\n"; + } + $show_stats_overrides .= "Server: $nameserver\nQueries sent: $queries_sent\nQueries retried or failed: $queries_retried_failed\n\n"; + } else { + $show_stats_output .= "Server: $nameserver\nQueries sent: $queries_sent\nQueries retried or failed: $queries_retried_failed\n\n"; + } } + $show_stats_output .= $show_stats_overrides; } sub print_stats { @@ -162,17 +186,36 @@ sub get_dns_nameservers { $show_nameservers_output .= "-----------------------------------------------\n"; $show_nameservers_output .= " Nameservers configured for DNS forwarding\n"; $show_nameservers_output .= "-----------------------------------------------\n"; + + my $line_flag; + ## server=/test.com/1.1.1.1 foreach my $line (@dnsmasq_conf_nameservers) { my @split_line = split(/=/, $line); my @nameserver_array = split(/\s+/, $split_line[1]); my $nameserver = $nameserver_array[0]; + my $domain; + my @domain_tokens; + + if ($nameserver_array[2] eq "domain-override") + { + #$nameserver has /test.com/1.1.1.1, seperate it. + @domain_tokens = split(/\//, $nameserver); + if (!defined($line_flag)) { + $line_flag = 1; + $show_nameservers_output .= "\n"; + $show_nameservers_output .= "Domain Overrides\n"; + $show_nameservers_output .= "\n"; + } + } $active_nameservers[$active_nameserver_count] = $nameserver; $active_nameserver_count++; my $nameserver_via = $nameserver_array[2]; if (@nameserver_array > 3){ my $dhcp_interface = $nameserver_array[3]; $show_nameservers_output .= "$nameserver available via '$nameserver_via $dhcp_interface'\n"; - } else { + } elsif (@domain_tokens) { + $show_nameservers_output .= "$domain_tokens[1] uses $domain_tokens[2] via '$nameserver_via'\n"; + } else { $show_nameservers_output .= "$nameserver available via '$nameserver_via'\n"; } } diff --git a/scripts/vyatta-reboot.pl b/scripts/vyatta-reboot.pl index f738986..3dc212c 100755 --- a/scripts/vyatta-reboot.pl +++ b/scripts/vyatta-reboot.pl @@ -116,7 +116,7 @@ if ($action eq "reboot") { do_reboot($login); } else { if (defined($ENV{VYATTA_PROCESS_CLIENT} && $ENV{VYATTA_PROCESS_CLIENT} eq 'gui2_rest') || - prompt("Proceed with reboot? (Yes/No) [No] ", -yn1d=>"n")) { + prompt("Proceed with reboot? (Yes/No) [No] ", -ynd=>"n")) { do_reboot($login); } else { print "Reboot canceled\n"; diff --git a/templates/install/node.def b/templates/install/node.def index 429a29b..a52b606 100644 --- a/templates/install/node.def +++ b/templates/install/node.def @@ -1 +1 @@ -help: Install vyatta +help: Install a new system diff --git a/templates/show/system/boot-messages/commit/node.def b/templates/show/system/boot-messages/commit/node.def deleted file mode 100644 index 60e1f67..0000000 --- a/templates/show/system/boot-messages/commit/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show the commit messages from this boot -run: cat /var/log/vyatta/vyatta-commit-this-boot.log |