Skip to content

Commit

Permalink
SCRIPTS: Adds dbod-upload-file (dummy)
Browse files Browse the repository at this point in the history
- Fixes #73
  • Loading branch information
icot committed Dec 9, 2016
1 parent d718fca commit cae32e2
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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;
45 changes: 45 additions & 0 deletions scripts/dbod-upload-file
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);

0 comments on commit cae32e2

Please sign in to comment.