#989 netdisco-deploy and netdisco-db-deploy respect ND2_DB_ROLLBACK

This commit is contained in:
Oliver Gorwits
2023-03-08 13:49:02 +00:00
parent b33737a335
commit db112d99cd
3 changed files with 17 additions and 0 deletions

View File

@@ -36,6 +36,10 @@ sub update_stats {
my $snmpinfo_ver = ($@ ? 'n/a' : $SNMP::Info::VERSION);
my $postgres_ver = pretty_version($schema->storage->dbh->{pg_server_version}, 2);
# roll everything back if we're testing
my $txn_guard = $ENV{ND2_DB_ROLLBACK}
? $schema->storage->txn_scope_guard : undef;
# TODO: (when we have the capabilities table?)
# $stats{waps} = sql_scalar('device',['COUNT(*)'], {"model"=>"AIR%"});