diff --git a/debian/control b/debian/control index 3e0a39c5..b7ddde62 100644 --- a/debian/control +++ b/debian/control @@ -41,6 +41,7 @@ Depends: etckeeper, libyaml-perl, libyaml-tiny-perl, netcat | netcat-traditional, + ngcp-system-tools, ${misc:Depends}, ${perl:Depends} Description: central and templated based Configuration Management System for NGCP platforms diff --git a/sbin/ngcp-sync-constants b/sbin/ngcp-sync-constants index f5f07a58..e4545a5d 100755 --- a/sbin/ngcp-sync-constants +++ b/sbin/ngcp-sync-constants @@ -6,9 +6,8 @@ use strict; use DBI; use YAML::Tiny; use Getopt::Long; -use Sys::Hostname::Long; use Data::Dumper; -use IPC::System::Simple qw(system); +use IPC::System::Simple qw(system capturex); #---------------------------------------------------------------------- use constant CONSTANTS_YML => "/etc/ngcp-config/constants.yml"; use constant MYSQL_CREDENTIALS => "/etc/mysql/sipwise.cnf"; @@ -52,6 +51,7 @@ use constant COPY_PASSWORDS => [ # pairs of from/to { reminder => { dbuser => 'dbpassword' }} ]; +use constant NGCP_NODENAME => "/etc/ngcp_ha_node"; sub Usage { print <$l\n" if $debug; + return $l; +} + sub connect_db { get_mysql_credentials(); $dbh = DBI->connect("DBI:mysql:database=$mysql_db; @@ -152,7 +160,7 @@ SQL # special handling for getting replication set up or in sync if($user eq 'replicator') { my $minfo = '/var/lib/mysql/master.info'; - my $mhost = hostname_long(); + my $mhost = get_nodename(); if($mhost eq 'sp1') { $mhost = 'sp2'; } elsif($mhost eq 'sp2') {