Skip to content

Commit 44371e3

Browse files
author
Marcin Przepiorowski
committed
fixes for MS SQL dsource creation for 5.2
1 parent f611542 commit 44371e3

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

lib/MSSQLVDB_obj.pm

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,33 @@ sub addSource {
531531
}
532532
);
533533

534-
if (defined($delphixmanaged) && ($delphixmanaged eq 'yes')) {
535-
$dsource_params{"linkData"}{"delphixManaged"} = JSON::true;
534+
if (defined($backup_dir) && ($backup_dir eq '')) {
535+
# autobackup dir set
536+
delete $dsource_params{"linkData"}{sharedBackupLocation};
537+
}
538+
539+
if ($self->{_dlpxObject}->getApi() lt "1.9") {
540+
if (defined($delphixmanaged) && ($delphixmanaged eq 'yes')) {
541+
$dsource_params{"linkData"}{"delphixManaged"} = JSON::true;
542+
delete $dsource_params{"linkData"}{"sourcingPolicy"}{"loadFromBackup"};
543+
}
544+
} else {
536545
delete $dsource_params{"linkData"}{"sourcingPolicy"}{"loadFromBackup"};
546+
547+
if (defined($delphixmanaged) && ($delphixmanaged eq 'yes')) {
548+
$dsource_params{"linkData"}{"delphixManagedStatus"} = 'DELPHIX_MANAGED_UNCOMPRESSED';
549+
$dsource_params{"linkData"}{"syncParameters"}{"type"} = "MSSqlNewCopyOnlyFullBackupSyncParameters";
550+
$dsource_params{"linkData"}{"syncParameters"}{"compressionEnabled"} = JSON::false;
551+
} else {
552+
$dsource_params{"linkData"}{"syncParameters"}{"type"} = "MSSqlExistingMostRecentBackupSyncParameters";
553+
}
537554
}
555+
556+
if (defined($dumppwd)) {
557+
$dsource_params{"linkData"}{encryptionKey} = $dumppwd;
558+
}
559+
560+
538561
}
539562

540563

@@ -768,8 +791,20 @@ sub getDelphixManaged {
768791

769792
logger($self->{_debug}, "Entering MSSQLVDB_obj::getDelphixManaged",1);
770793
my $ret;
771-
if (defined($self->{container}->{delphixManaged})) {
772-
$ret = $self->{container}->{delphixManaged} ? 'yes' : 'no';
794+
795+
if ($self->{_dlpxObject}->getApi() lt "1.9") {
796+
if (defined($self->{container}->{delphixManaged})) {
797+
$ret = $self->{container}->{delphixManaged} ? 'yes' : 'no';
798+
}
799+
} else {
800+
801+
if (defined($self->{container}->{delphixManagedStatus})) {
802+
if ($self->{container}->{delphixManagedStatus} eq 'NOT_DELPHIX_MANAGED') {
803+
$ret = 'no';
804+
} else {
805+
$ret = 'yes';
806+
}
807+
}
773808
}
774809
return $ret;
775810

0 commit comments

Comments
 (0)