diff options
author | Michael Elkins <melkins@tislabs.com> | 2014-04-07 17:38:40 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2014-04-07 17:38:40 +0000 |
commit | 1a1c9b672049f1e6836bbccd96fe1734cc791456 (patch) | |
tree | a1e2c0b8336a7ffa267261fc184c64f666ec01ea /rpkid/rpki-sql-backup | |
parent | b403f46676c6dcde856f3a943361f08c2a6fe5f3 (diff) | |
parent | aa28ef54c271fbe4d52860ff8cf13cab19e2207c (diff) |
merge with ^/trunk
svn path=/branches/tk674/; revision=5761
Diffstat (limited to 'rpkid/rpki-sql-backup')
-rwxr-xr-x | rpkid/rpki-sql-backup | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/rpkid/rpki-sql-backup b/rpkid/rpki-sql-backup index f90ee1e8..0b2d079d 100755 --- a/rpkid/rpki-sql-backup +++ b/rpkid/rpki-sql-backup @@ -43,19 +43,11 @@ args = parser.parse_args() cfg = rpki.config.parser(args.config, "myrpki") -def dump(section): - subprocess.check_call( - ("mysqldump", "--add-drop-database", - "-u", cfg.get("sql-username", section = section), - "-p" + cfg.get("sql-password", section = section), - "-B", cfg.get("sql-database", section = section)), - stdout = args.output) - -if cfg.getboolean("start_rpkid", False): - dump("irdbd") - -if cfg.getboolean("start_irdbd", False): - dump("rpkid") - -if cfg.getboolean("start_pubd", False): - dump("pubd") +for name in ("rpkid", "irdbd", "pubd"): + if cfg.getboolean("start_" + name, False): + subprocess.check_call( + ("mysqldump", "--add-drop-database", + "-u", cfg.get("sql-username", section = name), + "-p" + cfg.get("sql-password", section = name), + "-B", cfg.get("sql-database", section = name)), + stdout = args.output) |