'Removes the closing VirtualHost tag if it exists.
This method modifies vh_contents directly to remove the closing
tag. If the closing vhost tag is found, everything on the line
after it is also removed. Whether or not this tag is included
in the result of span depends on the Augeas version.
:param list vh_contents: VirtualHost block contents to check'

def _remove_closing_vhost_tag(self, vh_contents):

    for (offset, line) in enumerate(reversed(vh_contents)):
        if line:
            line_index = line.lower().find('</virtualhost>')
            if (line_index != (-1)):
                content_index = ((len(vh_contents) - offset) - 1)
                vh_contents[content_index] = line[:line_index]
            break
