Skip to content

Commit d60703b

Browse files
author
Marcin Przepiorowski
committed
staging push to use dsource name if sourcename is notprovided
1 parent 7ace48f commit d60703b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/MSSQLVDB_obj.pm

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,6 +1405,9 @@ sub attach_dsource
14051405
my $source_env_ref;
14061406
my $source_os_ref;
14071407

1408+
print Dumper "slon";
1409+
print Dumper $self->getName();
1410+
14081411
if ( $self->setEnvironment($env) ) {
14091412
print "Staging environment $env not found. dSource won't be attached\n";
14101413
return undef;
@@ -1623,8 +1626,14 @@ sub attach_dsource
16231626
$attach_data{"attachData"}{"syncStrategy"}{"compressionEnabled"} = $compression_json;
16241627
} elsif (defined($stagingpush)) {
16251628
$attach_data{"attachData"}{"syncStrategy"}{"type"} = "MSSqlStagingPushSyncStrategy";
1626-
$attach_data{"attachData"}{"syncParameters"}{"type"} = "MSSqlNoBackupSyncParameters";
1627-
$attach_data{"attachData"}{"syncStrategy"}{"stagingDatabaseName"} = $source;
1629+
$attach_data{"attachData"}{"syncParameters"}{"type"} = "MSSqlNoBackupSyncParameters";
1630+
my $staging_name;
1631+
if (defined($source)) {
1632+
$staging_name = $source;
1633+
} else {
1634+
$staging_name = $self->getName();
1635+
}
1636+
$attach_data{"attachData"}{"syncStrategy"}{"stagingDatabaseName"} = $staging_name;
16281637
} else {
16291638
$attach_data{"attachData"}{"syncStrategy"}{"config"} = $config->{reference};
16301639
$attach_data{"attachData"}{"sharedBackupLocations"} = \@backup_loc;

0 commit comments

Comments
 (0)