Skip to content

should check both 'http_proxy' and 'HTTP_PROXY' when get proxy info from environment variables #5137

@yitian-reevo

Description

@yitian-reevo

SUMMARY

I just faced an embarrassed problem that command st2 action list keeps return 503.

I tried st2 --debug action list and the result in line HTTP_PROXY(uppercase) was empty. This mislead me that the proxy info was set(which is not).

I finally found that the root cause is a lowercase http_proxy env variable was set in the system.

So I think it maybe more friendly to check both 'http_proxy' and 'HTTP_PROXY' to get proxy info when using st2 command with --debug option.

related code:

print('HTTP_PROXY: %s' % (os.environ.get('HTTP_PROXY', '')))

STACKSTORM VERSION

3.3

OS, environment, install method

centos 7.6, custom install

Steps to reproduce the problem

  1. set lowercase proxy environment variable, eg. export http_proxy='127.0.0.1:8888'
  2. run st2 --debug action list

Expected Results

proxy info should be printed

Actual Results

proxy info did not show, value of HTTP_PROXY is empty.

Thanks!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions