IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23934


Ignore:
Timestamp:
Apr 20, 2009, 11:23:23 AM (17 years ago)
Author:
jhoblitt
Message:

merge neb_distrib_20081210

Location:
trunk/Nebulous
Files:
2 deleted
34 edited
21 copied

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/eam_branches/eam_branch_20090303/Nebulous23158-23228
      /branches/jhoblitt/Nebulous2785-12604
      /branches/pap/Nebulous23511-23685,​23690-23739
  • trunk/Nebulous/Build.PL

    r22739 r23934  
    9595        'Nebulous::Server::SOAP'    => 0,
    9696        'Test::Nebulous'            => 0,
     97        'Test::Cmd'                 => '1.05',
    9798        'Apache2::SOAP'             => 0,
    9899        'Apache::DBI'               => '1.05',
  • trunk/Nebulous/Changes

    r23709 r23934  
    99    - add neb-swap
    1010    - add nebclient:nebSetXattr()
    11     - add neb-rm --move flag
    1211
    13120.09 Wed Jul  9 16:36:27 HST 2008
  • trunk/Nebulous/MANIFEST

    r23350 r23934  
    9898t/66_client_xattr.t
    9999t/67_client_swap.t
     100t/70_neb-ls.t
    100101t/90_nebclient.t
    101102t/TEST.PL
  • trunk/Nebulous/bin

  • trunk/Nebulous/bin/neb-ls

    r18092 r23934  
    11#!/usr/bin/env perl
    22
    3 # Copyright (C) 2007-2008  Joshua Hoblitt
    4 #
    5 # $Id: neb-ls,v 1.7 2008-06-12 20:03:37 jhoblitt Exp $
     3# Copyright (C) 2007-2009  Joshua Hoblitt
    64
    75use strict;
     
    97
    108use vars qw( $VERSION );
    11 $VERSION = '0.02';
     9$VERSION = '0.03';
    1210
    1311use Nebulous::Client;
     
    1614use Pod::Usage qw( pod2usage );
    1715
    18 my ($server, $long, $recursive);
     16my (
     17    $server,
     18    $long,
     19#    $recursive,
     20);
    1921
    2022$server = $ENV{'NEB_SERVER'} unless $server;
     
    2224GetOptions(
    2325    'server|s=s'    => \$server,
    24     'recursive|r'   => \$recursive,
     26#    'recursive|r'   => \$recursive,
    2527    'l|1'           => \$long,
    2628) || pod2usage( 2 );
     
    3941    unless defined $neb;
    4042
    41 # default to listing everything (bad idea?)
    42 $pattern ||= ".*";
     43# default to listing root
     44$pattern ||= "/";
    4345
    44 if ($recursive) {
    45     $pattern = "^" . $pattern . ".*";
    46 } else {
    47     $pattern = "^" . $pattern . "\$";
    48 }
     46#if ($recursive) {
     47#    $pattern = "^" . $pattern . ".*";
     48#} else {
     49#    $pattern = "^" . $pattern . "\$";
     50#}
    4951
    5052my $keys = $neb->find_objects($pattern);
     
    8688Optional
    8789
    88 =item * --recursive|-r
    89 
    90 By default C<neb-ls> will only try to match the exact string provided to it.
    91 With this option set all keys which match C<<pattern>> as a REGEX or substring
    92 will be returned.
    93 
    94 Optional
    95 
     90=cut
     91#=item * --recursive|-r
     92#
     93#By default C<neb-ls> will only try to match the exact string provided to it.
     94#With this option set all keys which match C<<pattern>> as a REGEX or substring
     95#will be returned.
     96#
     97#Optional
     98#
    9699=item * --server|-s <URL>
    97100
     
    130133=head1 COPYRIGHT
    131134
    132 Copyright (C) 2007-2008  Joshua Hoblitt.  All rights reserved.
     135Copyright (C) 2007-2009  Joshua Hoblitt.  All rights reserved.
    133136
    134137This program is free software; you can redistribute it and/or modify it under
  • trunk/Nebulous/examples

  • trunk/Nebulous/lib

  • trunk/Nebulous/lib/Nebulous/Client.pm

    r20988 r23934  
    243243        # if the copy failed we now have a zero length instances floating
    244244        # around that must be removed
    245         unless ($self->delete_instance("$uri")) {
     245        unless ($self->delete_instance($key, "$uri")) {
    246246            $log->logdie( "can not copy instance $uri AND FAILED TO CLEANUP EMPTY INSTANCE" );
    247247        }
     
    256256
    257257    unless ($src_md5 eq $dst_md5) {
    258         $self->delete_instance("$uri");
     258        $self->delete_instance($key, "$uri");
    259259        $log->logdie( "md5sum mismatch" );
    260260    }
     
    327327    }
    328328
    329     my $uri = $self->delete_instance( @$locations[0] );
     329    my $uri = $self->delete_instance($key, @$locations[0]);
    330330
    331331    $log->debug("leaving");
     
    615615            return;
    616616        }
     617        if ($response->faultstring =~ /does not match any key or directory/) {
     618            $log->debug( "leaving" );
     619            return;
     620        }
    617621
    618622        $log->logdie("unhandled fault - ", $self->err);
     
    813817    # a lock is implicitly removed when the last storage object is deleted
    814818    foreach my $uri ( @$locations ) {
    815         $self->delete_instance( $uri ) or return undef;
     819        $self->delete_instance($key, $uri) or return undef;
    816820    }
    817821
     
    944948    my $self = shift;
    945949
    946     my ($uri) = validate_pos(@_,
     950    my ($key, $uri) = validate_pos(@_,
     951        {
     952            type => SCALAR,
     953        },
    947954        {
    948955            type => SCALAR,
     
    961968    $log->logdie( $@ ) if $@;
    962969
    963     my $response = $self->{ 'server' }->delete_instance( $uri );
     970    my $response = $self->{ 'server' }->delete_instance($key, $uri);
    964971    if ( $response->fault ) {
    965972        $self->set_err($response->faultstring);
  • trunk/Nebulous/lib/Nebulous/Util.pm

    r18463 r23934  
    4545
    4646
     47# XXX replace the unlink with a 'move to trash' operation
     48# empty the trash with a daemon on the NSF server
    4749sub _nuke_file {
    4850    my $path = shift;
  • trunk/Nebulous/nebclient/tests/tap

    • Property svn:ignore
      •  

        old new  
         1.in
         2Makefile
         3Makefile.in
         4aclocal.m4
         5autom4te.cache
         6config.log
         7config.status
        18configure
        2 Makefile.in
        3 config.log
        4 depcomp
        5 config.status
        6 config.guess
        7 ltmain.sh
        8 config.sub
        9 autom4te.cache
        109libtool
        11 missing
        12 aclocal.m4
        13 Makefile
        14 install-sh
        15 src/Makefile.in
        16 src/stamp-h1
        17 src/config.h
        18 src/config.h.in
        19 src/.deps
        20 src/Makefile
         10*.bb
         11*.bbg
         12*.da
         13gmon.out
  • trunk/Nebulous/nebclient/tests/tap/bootstrap.sh

    r13100 r23934  
    22
    33set -x
    4 aclocal || exit 1
    5 autoheader || autoheader || exit 1
    6 libtoolize -c -f || libtoolize -c -f || glibtoolize -c -f || exit 1
    7 automake -a -c || automake -a -c || exit 1
    8 autoconf || autoconf || exit 1
     4aclocal19 -I /usr/local/share/aclocal || aclocal || exit 1
     5autoheader259 || autoheader || exit 1
     6libtoolize15 -c -f || libtoolize -c -f || glibtoolize -c -f || exit 1
     7automake19 -a -c || automake -a -c || exit 1
     8autoconf259 || autoconf || exit 1
  • trunk/Nebulous/nebclient/tests/tap/src

    • Property svn:ignore
      •  

        old new  
         1.deps
         2.libs
         3Makefile
        14Makefile.in
        2 ignore
        3 stamp-h1
         5libtap.la
         6tap.lo
        47config.h
        58config.h.in
        6 .deps
        7 Makefile
        8 .libs
         9stamp-h1
         10*.bb
         11*.bbg
         12*.da
         13gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests

    • Property svn:ignore set to
      Makefile
      Makefile.in
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/diag

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/fail

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/ok

    • Property svn:ignore set to
      Makefile
      Makefile.in
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/ok/ok

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/ok/ok-hash

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/ok/ok-numeric

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/pass

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/plan

    • Property svn:ignore set to
      Makefile
      Makefile.in
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/plan/no-tests

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/plan/no_plan

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/plan/not-enough-tests

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/plan/sane

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/plan/skip_all

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/plan/too-many-plans

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/plan/too-many-tests

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/skip

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/nebclient/tests/tap/tests/todo

    • Property svn:ignore set to
      .deps
      Makefile
      Makefile.in
      .libs
      test
      test.c.out
      test.pl.out
      *.bb
      *.bbg
      *.da
      gmon.out
  • trunk/Nebulous/t

  • trunk/Nebulous/t/62_client_delete_instance.t

    r20988 r23934  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 62_client_delete_instance.t,v 1.3 2008-12-14 22:48:35 eugene Exp $
     5# $Id: 62_client_delete_instance.t,v 1.1.38.1 2008-12-14 22:03:08 eugene Exp $
    66
    77use strict;
     
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 9;
     12plan tests => 11;
    1313
    1414use lib qw( ./t ./lib );
     
    2626        proxy => "http://$hostport/nebulous",
    2727    );
    28     $neb->create( "foo" );
    2928
    30     my $locations = $neb->find_instances( "foo" );
     29    my $key = "foo";
     30    $neb->create($key);
    3131
    32     my $uri = $neb->delete_instance( @$locations[0] );
     32    my $locations = $neb->find_instances($key);
     33
     34    my $uri = $neb->delete_instance($key, @$locations[0]);
    3335
    3436    is( $uri, @$locations[0], "delete instance" );
     
    4345        proxy => "http://$hostport/nebulous",
    4446    );
    45     $neb->create( "foo" );
    46     $neb->replicate( "foo" );
     47    my $key = "foo";
     48    $neb->create($key);
     49    $neb->replicate($key);
    4750
    4851    my $uri1 = $neb->find_instances( "foo" )->[0];
    4952
    50     ok( $neb->delete_instance( $uri1 ), "delete instance" );
     53    ok( $neb->delete_instance($key, $uri1), "delete instance" );
    5154
    5255    my $uri2 = $neb->find_instances( "foo" )->[0];
     
    5457    isnt( $uri1, $uri2, "other instance remains" );
    5558
    56     ok( $neb->delete_instance( $uri2 ), "delete instance" );
     59    ok( $neb->delete_instance($key, $uri2), "delete instance" );
    5760
    5861    my $locations = $neb->find_instances( "foo" );
    5962
    60     is( $locations, undef, "no remaning instances" );
     63    is( $locations, undef, "no remaining instances" );
    6164}
     65
     66Test::Nebulous->setup;
    6267
    6368{
     
    6570        proxy => "http://$hostport/nebulous",
    6671    );
    67     my $uri = $neb->delete_instance( "file:/foo" );
     72    my $key = "foo";
     73    $neb->create($key);
     74    my $uri = $neb->delete_instance($key, "file:/foo" );
    6875
    6976    is( $uri, undef, "uri does not exist" );
     
    7683        proxy => "http://$hostport/nebulous",
    7784    );
    78     $neb->delete_instance();
     85    my $uri = $neb->delete_instance("foo", "file:/foo" );
    7986};
    80 like( $@, qr/1 was expected/, "no params" );
     87like( $@, qr/is valid object key/, "bad object key" );
    8188
    8289Test::Nebulous->setup;
     
    8693        proxy => "http://$hostport/nebulous",
    8794    );
    88     $neb->delete_instance( "foo", 2 );
     95    my $uri = $neb->delete_instance("foo");
    8996};
    90 like( $@, qr/1 was expected/, "too many params" );
     97like( $@, qr/2 were expected/, "missing second param" );
     98
     99Test::Nebulous->setup;
     100
     101eval {
     102    my $neb = Nebulous::Client->new(
     103        proxy => "http://$hostport/nebulous",
     104    );
     105    $neb->delete_instance();
     106};
     107like( $@, qr/2 were expected/, "no params" );
     108
     109Test::Nebulous->setup;
     110
     111eval {
     112    my $neb = Nebulous::Client->new(
     113        proxy => "http://$hostport/nebulous",
     114    );
     115    $neb->delete_instance("foo", 2, 3);
     116};
     117like( $@, qr/2 were expected/, "too many params" );
    91118
    92119Test::Nebulous->cleanup;
  • trunk/Nebulous/t/conf/startup.pl.in

    r16281 r23934  
    1212use Test::Nebulous;
    1313
     14#$Apache::DBI::DEBUG = 1;
    1415Apache::DBI->connect_on_init( $NEB_DB, $NEB_USER, $NEB_PASS );
    15 Nebulous::Server::SOAP->new_on_init(
     16Apache::DBI->setPingTimeOut($NEB_DB, 10);
     17
     18my $config = Nebulous::Server::Config->new(
     19    trace       => 'all',
     20);
     21$config->add_db(
     22    dbindex     => 0,
    1623    dsn         => $NEB_DB,
    1724    dbuser      => $NEB_USER,
    1825    dbpasswd    => $NEB_PASS,
    19     log_level   => 'all',
    2026);
     27#$config->add_db(
     28#    dbindex     => 1,
     29#    dsn         => 'DBI:mysql:database=nebulous1:host=localhost',
     30#    dbuser      => $dbuser,
     31#    dbpasswd    => $dbpasswd,
     32#);
     33
     34Nebulous::Server::SOAP->new_on_init($config);
    2135
    22361;
Note: See TracChangeset for help on using the changeset viewer.