

def get_subscription(self, deadline=60):
    sub = None
    log.debug('getting subscription')
    try:
        self.client.projects().subscriptions().delete(subscription='projects/{}/subscriptions/{}'.format(self.project, self.subname)).execute()
        log.debug('deleted existing subscription')
    except HttpError as e:
        if (e.resp.status == 404):
            sub = self.create_subscription(deadline=deadline)
        else:
            raise
    else:
        sub = sub.create_subscription(deadline=deadline)
    log.debug(('subscription %s' % sub))
    return sub

dataset/ETHPy150Open GoogleCloudPlatform/reliable-task-scheduling-compute-engine-sample/gce/cron_executor.py Executor.get_subscription/VarMisuse@117/141 `self`->`sub`