'This method will discard the output the shell sends, it will read it from
the xml where it expects it to be present.
NOTE: if \'debug\' is true then it is being run from a test case and the
output being sent is valid.'

def parseOutputString(self, output, debug=False):

    parser = MetasploitXmlParser(output)
    for item in parser.hosts:
        h_id = self.createAndAddHost(item.ip, item.os)
        if self._isIPV4(item.ip):
            i_id = self.createAndAddInterface(h_id, item.ip, ipv4_address=item.ip, hostname_resolution=item.host)
        else:
            i_id = self.createAndAddInterface(h_id, item.ip, ipv6_address=item.ip, hostname_resolution=item.host)
        if ((item.id + '_') in item.notesByService):
            for n in item.notesByService[(item.id + '_')]:
                self.createAndAddNoteToHost(h_id, n.ntype, n.data)
        for v in item.vulnsByHost:
            v_id = self.createAndAddVulnToHost(h_id, v.name, v.desc, ref=v.refs)
        for s in item.services:
            s_id = self.createAndAddServiceToInterface(h_id, i_id, s['name'], s['proto'], ports=[s['port']], status=s['state'], description=s['info'])
            if (((item.id + '_') + s['id']) in item.notesByService):
                for n in item.notesByService[((item.id + '_') + s['id'])]:
                    self.createAndAddNoteToService(h_id, s_id, n.ntype, n.data)
            if (s['port'] in item.credsByService):
                for c in item.credsByService[s['port']]:
                    self.createAndAddCredToService(h_id, s_id, c.user, c.passwd)
                    self.createAndAddVulnToService(h_id, s_id, 'Weak    Credentials', ('[metasploit    found    the    following    credentials]\nuser:%s\npass:%s' % (c.user, c.passwd)), severity='high')
            n_id = None
            for v in item.vulnsByService[s['id']]:
                if v.isWeb:
                    if (n_id == None):
                        n_id = self.createAndAddNoteToService(h_id, s_id, 'website', '')
                    n2_id = self.createAndAddNoteToNote(h_id, s_id, n_id, v.host, '')
                    v_id = self.createAndAddVulnWebToService(h_id, s_id, v.name, v.desc, severity=v.risk, website=v.host, path=v.path, request=v.request, method=v.method, pname=v.pname, params=v.params, query=v.query, category=v.category)
                else:
                    v_id = self.createAndAddVulnToService(h_id, s_id, v.name, v.desc, ref=v.refs)
    del parser
