Changeset 27c5f3e for fedd


Ignore:
Timestamp:
Oct 25, 2013 1:42:26 PM (11 years ago)
Author:
Ted Faber <faber@…>
Branches:
master
Children:
f725eda
Parents:
5afcc33
Message:

Properly deal with parse failures locally

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    r5afcc33 r27c5f3e  
    18841884            # must be writable by the fedd user.  Doing this in the
    18851885            # temporary subdir ensures this is the case.
    1886             tclparser = Popen(tclcmd, stdout=PIPE, close_fds=True,
     1886            tclparser = Popen(tclcmd, stdout=PIPE, stderr=PIPE, close_fds=True,
    18871887                    cwd=tmpdir)
    1888             split_data = tclparser.stdout
    1889 
    1890             top = topdl.topology_from_xml(file=split_data, top="experiment")
     1888            split_data, err_data = tclparser.communicate()
     1889
     1890            if tclparser.returncode != 0:
     1891                os.remove(tclfile)
     1892                raise service_error(service_error.req,
     1893                        "Cannot parse input ns2: %s" % err_data)
     1894
     1895            top = topdl.topology_from_xml(string=split_data, top="experiment")
    18911896            os.remove(tclfile)
    18921897
Note: See TracChangeset for help on using the changeset viewer.