IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 20, 2008, 3:25:21 PM (18 years ago)
Author:
jhoblitt
Message:

add Nebulous::Server::mounts()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/lib/Nebulous/Server.pm

    r17074 r17077  
    1 # Copyright (c) 2004  Joshua Hoblitt
     1# Copyright (c) 2004-2008  Joshua Hoblitt
    22#
    3 # $Id: Server.pm,v 1.56 2008-03-20 23:29:56 jhoblitt Exp $
     3# $Id: Server.pm,v 1.57 2008-03-21 01:24:36 jhoblitt Exp $
    44
    55package Nebulous::Server;
     
    11051105
    11061106
     1107sub mounts
     1108{
     1109    my $self = shift;
     1110
     1111    validate_pos(@_);
     1112
     1113    my $log = $self->log;
     1114    my $sql = $self->sql;
     1115    my $db  =$self->db;
     1116
     1117    $log->debug("entered - @_");
     1118
     1119    my $stats;
     1120    my $query;
     1121    eval {
     1122        # ask the db to generate the table of mounted Nebulous volume
     1123        $db->do("call getmountedvol()");
     1124
     1125        $query = $db->prepare_cached( $sql->get_mounted_volumes );
     1126        $query->execute();
     1127
     1128        # suck that table into an AoA
     1129        $stats = $query->fetchall_arrayref;
     1130
     1131        $query->finish;
     1132    };
     1133    $log->logdie("database error: $@") if $@;
     1134
     1135    $log->logdie("no mounted volumes found") unless (scalar @$stats);
     1136
     1137    $log->debug("leaving");
     1138
     1139    return $stats;
     1140}
     1141
     1142
    11071143sub _get_storage_volume
    11081144{
Note: See TracChangeset for help on using the changeset viewer.