Changeset c7141dc


Ignore:
Timestamp:
Jan 9, 2012 4:52:54 PM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, info-ops, master
Children:
d2e86f6
Parents:
06c1dba
Message:

Single access works

Location:
fedd/federation
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/access.py

    r06c1dba rc7141dc  
    2727import topdl
    2828import list_log
    29 import proxy_emulab_segment
    30 import local_emulab_segment
    3129
    3230
  • fedd/federation/deter_internal_access.py

    r06c1dba rc7141dc  
    2525import topdl
    2626import list_log
    27 import proxy_emulab_segment
    28 import local_emulab_segment
    2927
    3028from access import access_base
  • fedd/federation/dragon_access.py

    r06c1dba rc7141dc  
    2727import topdl
    2828import list_log
    29 import proxy_emulab_segment
    30 import local_emulab_segment
    3129
    3230
  • fedd/federation/emulab_access.py

    r06c1dba rc7141dc  
    11751175            starter = self.start_segment(keyfile=self.ssh_privkey_file,
    11761176                    debug=self.create_debug, log=alloc_log, boss=self.boss,
    1177                     cert=self.xmlrpc_cert)
     1177                    ops=self.ops, cert=self.xmlrpc_cert)
    11781178            rv = starter(self, ename, proj, user, expfile, tmpdir, gid=gid)
    11791179        except service_error, e:
     
    12411241                    "Can't find experiment name for %s" % aid)
    12421242        stopper = self.stop_segment(keyfile=self.ssh_privkey_file,
    1243                 debug=self.create_debug, boss=self.boss, cert=self.xmlrpc_cert)
     1243                debug=self.create_debug, boss=self.boss, ops=self.ops,
     1244                cert=self.xmlrpc_cert)
    12441245        stopper(self, user, proj, ename, gid, nonce)
    12451246        return { 'allocID': req['allocID'], 'proof': proof.to_dict() }
     
    12891290                    "Can't find experiment name for %s" % aid)
    12901291        info = self.info_segment(keyfile=self.ssh_privkey_file,
    1291                 debug=self.create_debug, boss=self.boss, cert=self.xmlrpc_cert)
     1292                debug=self.create_debug, boss=self.boss, ops=self.ops,
     1293                cert=self.xmlrpc_cert)
    12921294        info(self, user, proj, ename)
    12931295        self.decorate_topology(info, topo)
     
    13571359
    13581360        ops = self.operation_segment(keyfile=self.ssh_privkey_file,
    1359                 debug=self.create_debug, boss=self.boss,
     1361                debug=self.create_debug, boss=self.boss, ops=self.ops,
    13601362                cert=self.xmlrpc_cert)
    13611363        ops(self, op, ptargets, params, topo)
  • fedd/federation/emulab_segment.py

    r06c1dba rc7141dc  
    1818class start_segment(ssh_emulab_segment, xmlrpc_emulab_segment):
    1919    def __init__(self, log=None, keyfile=None, debug=False, boss=None,
    20             cert=None):
     20            ops=None, cert=None):
    2121        ssh_emulab_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
    22         xmlrpc_emulab_segment.__init__(self, boss=boss, cert=cert)
     22        xmlrpc_emulab_segment.__init__(self, boss=boss, ops=ops, cert=cert)
    2323
    2424    def set_up_experiment_filespace(self, user, host, pid, eid, tmpdir):
     
    100100            return False
    101101
    102         if not self.set_up_experiment_filespace(pid, eid, tmpdir):
     102        if not self.set_up_experiment_filespace(user, self.ops,
     103                pid, eid, tmpdir):
    103104            return False
    104105
     
    122123        return True
    123124
    124 class stop_segment(local_segment, emulab_segment):
     125class stop_segment(ssh_emulab_segment, xmlrpc_emulab_segment):
    125126    def __init__(self, log=None, keyfile=None, debug=False, boss=None,
    126             cert=None):
    127         local_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
    128         emulab_segment.__init__(self, boss=boss, cert=cert)
     127            ops=None, cert=None):
     128        ssh_emulab_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
     129        xmlrpc_emulab_segment.__init__(self, boss=boss, ops=ops, cert=cert)
    129130
    130131    def __call__(self, parent, user, pid, eid, gid=None, terminate=False):
     
    137138        try:
    138139            # Clean out tar files: we've gone over quota in the past
    139             self.ssh_cmd("rm -rf /proj/%s/software/%s" % (pid, eid))
     140            self.ssh_cmd(user, self.ops,
     141                    "rm -rf /proj/%s/software/%s" % (pid, eid))
    140142            rv = self.swap_exp(pid, eid, 'out')
    141143            if terminate:
     
    145147        return rv
    146148
    147 class info_segment(local_segment, emulab_segment):
     149class info_segment(ssh_emulab_segment, xmlrpc_emulab_segment):
    148150    def __init__(self, log=None, keyfile=None, debug=False, boss=None,
    149             cert=None):
    150         local_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
    151         emulab_segment.__init__(self, boss=boss, cert=cert)
     151            ops=None, cert=None):
     152        ssh_emulab_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
     153        xmlrpc_emulab_segment.__init__(self, boss=boss, ops=ops, cert=cert)
    152154
    153155    def __call__(self, parent, user, pid, eid):
     
    156158        return True
    157159
    158 class operation_segment(local_segment, emulab_segment):
     160class operation_segment(ssh_emulab_segment, xmlrpc_emulab_segment):
    159161    def __init__(self, log=None, keyfile=None, debug=False, boss=None,
    160             cert=None):
    161         local_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
    162         emulab_segment.__init__(self, boss=boss, cert=cert)
     162            ops=None, cert=None):
     163        ssh_emulab_segment.__init__(self, log=log, keyfile=keyfile, debug=debug)
     164        xmlrpc_emulab_segment.__init__(self, boss=boss, ops=ops, cert=cert)
    163165
    164166    def __call__(self, parent, op, targets, param, top):
  • fedd/federation/legacy_access.py

    r06c1dba rc7141dc  
    2727import topdl
    2828import list_log
    29 import proxy_emulab_segment
    30 import local_emulab_segment
    3129
    3230
  • fedd/federation/ssh_emulab_segment.py

    r06c1dba rc7141dc  
    2626        using ssh.
    2727        """
    28         self.log = log or logging.getLogger('fedd.access.proxy_segment')
     28        self.log = log or logging.getLogger('fedd.access.ssh_emulab_segment')
    2929        self.ssh_privkey_file = keyfile
    3030        self.debug = debug
    3131        self.ssh_exec="/usr/bin/ssh"
    3232        self.scp_exec = "/usr/bin/scp"
    33         self.ssh_cmd_timeout = proxy_segment.ssh_cmd_timeout
     33        self.ssh_cmd_timeout = ssh_emulab_segment.ssh_cmd_timeout
    3434
    3535    def scp_file(self, file, user, host, dest=""):
  • fedd/federation/xmlrpc_emulab_segment.py

    r06c1dba rc7141dc  
    3636            return rv
    3737
    38     def __init__(self, boss, cert):
     38    def __init__(self, boss, ops, cert):
    3939        self.ctxt = fedd_ssl_context(my_cert=cert)
    4040        self.ctxt.set_verify(SSL.verify_none, 10)
    4141        self.boss = boss
     42        self.ops = ops
    4243        self.null = """
    4344set ns [new Simulator]
     
    5354        self.node = { }
    5455        self.status = [ ]
    55         self.node_info = emulab_segment.node_info
     56        self.node_info = xmlrpc_emulab_segment.node_info
    5657
    5758    def emulab_call(self, method, params):
Note: See TracChangeset for help on using the changeset viewer.