Skip to content

Commit d0b5f4b

Browse files
author
Marcin Przepiorowski
committed
v2p_mssql_enhancement small fixes
2 parents dd07621 + 81a6a05 commit d0b5f4b

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

bin/dx_v2p.pl

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,21 @@
160160

161161

162162
if ( $db->setSource($source) ) {
163-
print "Problem with setting source. V2P won't be created.\n";
164-
exit(1);
163+
print "Problem with setting source. V2P won't be started.\n";
164+
$ret = $ret + 1;
165+
next;
165166
}
166167

167168
if ( $db->setTimestamp($timestamp) ) {
168169
print "Problem with setting timestamp $timestamp. V2P process won't be started.\n";
169-
exit(1);
170+
$ret = $ret + 1;
171+
next;
170172
}
171173

172174
$db->setName($dbname, $dbname);
173175

174176
if ( $db->setEnvironment($environment, $envUser) ) {
175-
print "Environment $environment or user $envUser not found. VDB won't be created\n";
177+
print "Environment $environment or user $envUser not found. V2P process won't be started\n";
176178
$ret = $ret + 1;
177179
next;
178180
}
@@ -182,13 +184,15 @@
182184

183185
if ( $db->setFileSystemLayout($targetDirectory,$archiveDirectory,$dataDirectory,$externalDirectory,$scriptDirectory,$tempDirectory, $useabsolute) ) {
184186
print "Problem with export file system layout. Is targetDiretory and dataDirectory set ?\n";
185-
exit(1);
187+
$ret = $ret + 1;
188+
next;
186189
}
187190

188191
if ( defined($template) ) {
189192
if ( $db->setTemplateV2P($template) ) {
190-
print "Template $template not found. V2P process won't be created\n";
191-
exit(1);
193+
print "Template $template not found. V2P process won't be started\n";
194+
$ret = $ret + 1;
195+
next;
192196
}
193197
}
194198

@@ -197,7 +201,9 @@
197201
$filemap_obj->loadMapFile($map_file);
198202
$filemap_obj->setSource($source);
199203
if ($filemap_obj->validate()) {
200-
die ("Problem with mapping file. V2P process won't be created.")
204+
print ("Problem with mapping file. V2P process won't be started.\n");
205+
$ret = $ret + 1;
206+
next;
201207
}
202208

203209
$db->setMapFileV2P($filemap_obj->GetMapping_rule());
@@ -211,7 +217,8 @@
211217
if (defined($concurrentfiles)) {
212218
if ($db->setFileParallelism($concurrentfiles)) {
213219
print "Problem with setting number of concurrent files\n";
214-
exit(1);
220+
$ret = $ret + 1;
221+
next;
215222
}
216223
};
217224

@@ -221,18 +228,20 @@
221228
}
222229
elsif ($type eq 'mssql') {
223230

224-
if ( $db->setFileSystemLayout($targetDirectory,$archiveDirectory,$dataDirectory,$externalDirectory,$scriptDirectory,$tempDirectory) ) {
225-
print Dumper "ale tu";
231+
if ( $db->setFileSystemLayout($targetDirectory,$archiveDirectory,$dataDirectory,$externalDirectory,$scriptDirectory,$tempDirectory) ) {;
226232
print "Problem with export file system layout. Is targetDiretory and dataDirectory set ?\n";
227-
exit(1);
233+
$ret = $ret + 1;
234+
next;
228235
}
229236

230237
if ( defined($map_file) ) {
231238
my $filemap_obj = new FileMap($engine_obj,$type,$debug);
232239
$filemap_obj->loadMapFile($map_file);
233240
$filemap_obj->setSource($source);
234241
if ($filemap_obj->validate($db->{"NEWDB"}->{"filesystemLayout"})) {
235-
die ("Problem with mapping file. V2P process won't be created.")
242+
print("Problem with mapping file. V2P process won't be started.\n");
243+
$ret = $ret + 1;
244+
next;
236245
}
237246

238247
$db->setMapFileV2P($filemap_obj->GetMapping_rule());

lib/FileMap.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ sub validate {
199199
$self->{mappedFiles} = $mapped_files;
200200
return 0;
201201
} else {
202+
print("Error with validation: " . $result->{error}->{details} . "\n");
202203
return 1;
203204
}
204205

0 commit comments

Comments
 (0)