flex.pl #1

  • //
  • guest/
  • netapp/
  • p4flex/
  • main/
  • demo/
  • flex.pl
  • View
  • Commits
  • Open Download .zip Download (1 KB)
#!/usr/local/bin/perl -w

use strict;
use warnings;
use feature qw/switch/;
use Data::Dumper;

# Open a file for READ
open (FILE, ">", "out.log") or die $!;

# Add some magic here...

print( "action: RESPOND\n" );

my $map;
foreach my $line (<STDIN>) {
  chomp $line;
  my @parts = split(/: /, $line);
  $map->{$parts[0]} = $parts[1];
}
print FILE Dumper($map);


my $cmd = $map->{'Arg0'};
my $name = $map->{'Arg1'};

given($cmd) {
  when(/create/) {
    create($name); 
  }
  when(/help/) {
    print( "message: todo\n" ); 
  }
  when(/client/) {
    print( "message: todo\n" );
  }
  when(/clients/) {
    print( "message: todo\n" ); 
  }
  default {
    print( "message: Unknown command.  Try 'p4 flex help' for info\n" );
  }
}

print( "message: EXIT\n" );
exit(0);



# ----------------------------------------------------------------------------
# Create a volume
# ----------------------------------------------------------------------------
sub create {
  my $name = shift;
  print( "message: running a flex clone create on '$name'\n" );
}
# Change User Description Committed
#4 20100 netapp No need for flex.pl file
#3 19636 netapp Reverting back to Agnes' original
#2 19474 netapp Uploaded new files for project.
Enhancements include:
1.    Added in snapshot deletion capability
2.    Created separate user clone mount directory, which can be different from the base directory
3.    Cleaned up error handling for all p4 flex calls, so errors are handled with understandable output, versus program crashes
4.    Added in ability to specify volume owner when creating a volume with �p4 flex volume �s �u�.
#1 18997 netapp Rename/move file(s)

Project name change:
moving
//guest/netapp/p4flexclone/main/…
to
//guest/netapp/p4flex/main/…
//guest/netapp/p4flexclone/main/demo/flex.pl
#2 13607 Paul Allen Added logging to out.log file and test commands...

$ p4 flex create foo
running a flex clone create on 'foo'

$ p4 flex client foo.ws1
todo
#1 13267 Paul Allen #review-13268 simple 'p4 flex' broker demo.