def call()

in files/default/rgw_webservice.py [0:0]


def call(cmd, remote_addr=None):
    if remote_addr is None:
        remote_addr = ''
    log.debug(str(datetime.datetime.utcnow()) + ' ' + remote_addr + ' ' + ' '.join([str(x) for x in cmd]))
    process = subprocess.Popen(cmd, env=os.environ.copy(), stdout=subprocess.PIPE)
    json_output, err = process.communicate()
    if err:
        log.error(err)
        return None

    # log.debug(json_output)

    return json_output