def mgbuild(self, args):
    try:
        s = subprocess.check_output((self.MGBUILD_CMD + args), stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError as err:
        print('ERROR: {}'.format(err.output))
        raise
    return s
def mgbuild(self, args):
    try:
        s = subprocess.check_output((self.MGBUILD_CMD + args), stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError as err:
        print('ERROR: {}'.format(err.output))
        raise
    return s