From 0311a396c90f5f8ffd01cac97d1697b77f2fc36e Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Wed, 27 Aug 2014 10:25:14 +0200 Subject: [PATCH] MT#8773 ngcp-sync-constants: grant user sipwise on pair when running with '-r' option Change-Id: I4f147fcae147e9c37b8f51dc5a9e1d946b716601 --- sbin/ngcp-sync-constants | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sbin/ngcp-sync-constants b/sbin/ngcp-sync-constants index b00fa789..277cd16c 100755 --- a/sbin/ngcp-sync-constants +++ b/sbin/ngcp-sync-constants @@ -526,6 +526,13 @@ sub do_pair_sync { print "Syncing ".CONSTANTS_YML." -> MySQL ... "; print "\n" if $debug; sync_mysql_data($dbh); + if ($mysql_root) { + # mysql sipwise user + my ($mysql_user, $mysql_pass) = get_mysql_credentials(); + my @hosts = ('localhost'); + grant_user(dbh => $dbh, user => $mysql_user, hosts => \@hosts, repuser => 0 ); + sync_user( dbh => $dbh, user => $mysql_user, pass => $mysql_pass ); + } }; if ($@) { $dbh->rollback;