-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCRIPTS: Adds dbod-upload-file (dummy)
- Fixes #73
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ use inc::Module::Install; | |
|
||
# Package metadata | ||
author 'Ignacio Coterillo <[email protected]>'; | ||
version '0.73'; | ||
version '0.74'; | ||
license 'GPLv3'; | ||
name 'DBOD'; | ||
|
||
|
@@ -53,5 +53,7 @@ install_script 'scripts/dbod-init'; | |
install_script 'scripts/dbod-ping'; | ||
install_script 'scripts/dbod-start'; | ||
install_script 'scripts/dbod-stop'; | ||
install_script 'scripts/dbod-upload-file'; | ||
install_script 'scripts/dbod-destroy'; | ||
|
||
WriteAll; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env perl | ||
# Copyright (C) 2015, CERN | ||
# This software is distributed under the terms of the GNU General Public | ||
# Licence version 3 (GPL Version 3), copied verbatim in the file "LICENSE". | ||
# In applying this license, CERN does not waive the privileges and immunities | ||
# granted to it by virtue of its status as Intergovernmental Organization | ||
# or submit itself to any jurisdiction. | ||
|
||
package dbod_file_upload; | ||
|
||
use warnings; | ||
use strict; | ||
|
||
use DBOD::Job; | ||
use Data::Dumper; | ||
|
||
my $job = DBOD::Job->new_with_options(); | ||
|
||
use DBOD qw ($ERROR $OK $db_type); | ||
use DBOD::Instance; | ||
|
||
sub body { | ||
|
||
$job->log->debug('Pinging ' . $job->entity() . '/' . | ||
$job->metadata->{db_type}); | ||
|
||
my $instance = DBOD::Instance::Factory->create( | ||
$db_type->{$job->metadata->{db_type}}, | ||
instance => $job->entity(), | ||
metadata => $job->metadata(), | ||
config => $job->config()); | ||
|
||
if ($job->is_local()) { | ||
$job->log->debug('Job running locally in instance host'); | ||
$job->log->info('Updating file!'); | ||
return $OK; | ||
} else { | ||
$job->log->debug('This job needs run locally'); | ||
return $ERROR; | ||
} | ||
return $OK; | ||
} | ||
|
||
$job->run(\&body); | ||
|