Ignore:
Timestamp:
Mar 10, 2014 5:25:42 PM (5 years ago)
Author:
Ted Faber <faber@…>
Branches:
master
Children:
d75005b
Parents:
a2ca699
Message:

Shared NAT integrated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/emulab_access.py

    r26821ac r8fbef04  
    3232import list_log
    3333import emulab_segment
     34import emulab_shared_nat_segment
    3435
    3536
     
    9192        self.node_startcommand = config.get("access", "node_startcommand")
    9293        self.nat_portal = config.get("access", "nat_portal")
     94        self.shared_nat = config.getboolean("access", "shared_nat")
    9395
    9496        self.uri = 'https://%s:%d' % (socket.getfqdn(),
     
    100102
    101103        self.access_type = self.access_type.lower()
    102         self.start_segment = emulab_segment.start_segment
    103         self.stop_segment = emulab_segment.stop_segment
    104         self.info_segment = emulab_segment.info_segment
    105         self.operation_segment = emulab_segment.operation_segment
    106         self.exports_segment = emulab_segment.exports_segment
     104        if self.shared_nat:
     105            self.start_segment = emulab_shared_nat_segment.start_segment
     106            self.stop_segment = emulab_shared_nat_segment.stop_segment
     107            self.info_segment = emulab_shared_nat_segment.info_segment
     108            self.operation_segment = emulab_shared_nat_segment.operation_segment
     109            self.exports_segment = emulab_shared_nat_segment.exports_segment
     110        else:
     111            self.start_segment = emulab_segment.start_segment
     112            self.stop_segment = emulab_segment.stop_segment
     113            self.info_segment = emulab_segment.info_segment
     114            self.operation_segment = emulab_segment.operation_segment
     115            self.exports_segment = emulab_segment.exports_segment
    107116
    108117        self.restricted = [ ]
     
    541550
    542551        if self.portal_command:
     552            if self.shared_nat: suffix = 'shared nat 0/0/tcp rdr 22/tcp'
     553            else: suffix = ''
     554
    543555            filters.append(topdl.generate_portal_command_filter(
    544                 self.portal_command, add_filter=add_filter))
     556                self.portal_command, add_filter=add_filter, suffix=suffix))
    545557
    546558        if self.portal_image:
     
    977989                    debug=self.create_debug, log=alloc_log, boss=self.boss,
    978990                    ops=self.ops, cert=xmlrpc_cert)
    979             exporter(self, ename, proj, user, connInfo, tmpdir, gid)
     991            if not exporter(self, ename, proj, user, connInfo, tmpdir, gid):
     992                raise service_error(service_error.internal,
     993                        'Failed to gather export variables')
    980994            self.export_store_info(certfile, proj, ename, connInfo)
    981995            self.import_store_info(certfile, connInfo)
Note: See TracChangeset for help on using the changeset viewer.