Changeset 5576a47 for fedd


Ignore:
Timestamp:
Nov 21, 2008 5:50:25 PM (16 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
0b123ff
Parents:
a94cb0a
Message:

project exporting in place

Location:
fedd
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_access.py

    ra94cb0a r5576a47  
    557557            restricted = None
    558558            ap = None
     559
     560            # If this is a request to export a project and the access project
     561            # is not the project to export, access denied.
     562            if req.has_key('exportProject'):
     563                ep = unpack_id(req['exportProject'])
     564                if ep != found[0].name:
     565                    raise service_error(service_error.access,
     566                            "Cannot export %s" % ep)
    559567
    560568            # Check for access to restricted nodes
  • fedd/fedd_client.py

    ra94cb0a r5576a47  
    109109        self.add_option("-f", "--file", dest="file",
    110110                help="experiment description file")
     111        self.add_option("-p", "--project", action="store", dest="project",
     112                type="string",
     113                help="Project to export from master")
    111114        if add_key_callback:
    112115            self.add_option("-k", "--sshKey", action="callback", type="string",
     
    493496            parser.error("--trusted is required")
    494497
     498        if not opts.project :
     499            parser.error('--project is required')
     500
    495501        if opts.debug > 0: opts.tracefile=sys.stderr
    496502
     
    531537                'experimentdescription': { 'ns2description': exp_desc },
    532538                'master': opts.master,
     539                'exportProject': { 'localname': opts.project },
    533540                'user' : [ {\
    534541                        'userID': pack_id(user), \
  • fedd/fedd_experiment_control.py

    ra94cb0a r5576a47  
    781781        else: return None
    782782
    783     def get_access(self, tb, nodes, user, tbparam):
     783    def get_access(self, tb, nodes, user, tbparam, master, export_project):
    784784        """
    785785        Get access to testbed through fedd and set the parameters for that tb
     
    811811                'serviceAccess' : [ { 'sshPubkey' : self.ssh_pubkey } ]
    812812            }
    813        
     813
     814        if tb == master:
     815            # NB, the export_project parameter is a dict that includes
     816            # the type
     817            req['exportProject'] = export_project
     818
    814819        # node resources if any
    815820        if nodes != None and len(nodes) > 0:
     
    10011006            self.get_access = get_access
    10021007
    1003         def __call__(self, line, user, tbparams):
     1008        def __call__(self, line, user, tbparams, master, export_project):
    10041009            # Testbed access parameters
    10051010            if not self.in_allbeds:
     
    10151020                    nodes = line.split('|')
    10161021                    tb = nodes.pop(0)
    1017                     self.get_access(tb, nodes, user, tbparams)
     1022                    self.get_access(tb, nodes, user, tbparams, master,
     1023                            export_project)
    10181024                return True
    10191025
     
    14021408
    14031409        master = req.get('master', None)
    1404         if master == None:
     1410        if not master:
    14051411            raise service_error(service_error.req, "No master testbed label")
     1412        export_project = req.get('exportProject', None)
     1413        if not export_project:
     1414            raise service_error(service_error.req, "No export project")
    14061415       
    14071416        if self.splitter_url:
     
    14451454            if parse_current_testbed(line, master, allocated, tbparams):
    14461455                continue
    1447             elif parse_allbeds(line, user, tbparams):
     1456            elif parse_allbeds(line, user, tbparams, master, export_project):
    14481457                continue
    14491458            elif parse_gateways(line, allocated, tbparams):
  • fedd/fedd_types.xsd

    ra94cb0a r5576a47  
    374374      <xsd:element name="serviceAccess" type="tns:accessType" minOccurs="1"
    375375        maxOccurs="unbounded"/>
     376      <xsd:element name="exportProject" type="tns:IDType"
     377        minOccurs="0" maxOccurs="1"/>
    376378      <xsd:element name="allocID" type="tns:IDType"/>
    377379      <xsd:element name="when" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
     
    441443        type="tns:experimentDescriptionType"/>
    442444      <xsd:element name="master" type="xsd:string"/>
     445      <xsd:element name='exportProject' type="tns:IDType"/>
    443446      <xsd:element name="experimentID" type="tns:IDType" minOccurs="0"
    444447        maxOccurs="1"/>
Note: See TracChangeset for help on using the changeset viewer.