コード例 #1
0
  def Run(self, args):
    cred = store.Load()
    if args.force_auth_refresh:
      store.Refresh(cred)

    config_name = named_configs.ConfigurationStore.ActiveConfig().name
    props = properties.VALUES.AllValues()

    return config_helper.ConfigHelperResult(
        credential=cred,
        active_configuration=config_name,
        properties=props,
    )
コード例 #2
0
    def Run(self, args):
        cred = store.Load()

        min_expiry_time_not_met = not cred.token_expiry or (
            cred.token_expiry.utcnow() >
            cred.token_expiry - datetime.timedelta(seconds=args.min_expiry))
        if args.force_auth_refresh or min_expiry_time_not_met:
            store.Refresh(cred)

        config_name = named_configs.ConfigurationStore.ActiveConfig().name
        props = properties.VALUES.AllValues()

        return config_helper.ConfigHelperResult(
            credential=cred,
            active_configuration=config_name,
            properties=props,
        )
コード例 #3
0
    def Run(self, args):
        cred = store.Load(use_google_auth=True)

        if args.force_auth_refresh:
            store.Refresh(cred)
        else:
            store.RefreshIfExpireWithinWindow(cred,
                                              '{}'.format(args.min_expiry))

        config_name = named_configs.ConfigurationStore.ActiveConfig().name
        props = properties.VALUES.AllValues()

        return config_helper.ConfigHelperResult(
            credential=cred,
            active_configuration=config_name,
            properties=props,
        )