Comments (6)
I tried adding this to /python_action_wrapper.py
to read the contents of /etc/environment
:
(ref: http://stackoverflow.com/questions/5971312/how-to-set-environment-variables-in-python)
import re
import os
LOG = logging.getLogger(__name__)
def _set_env_from_etc_environment(envFilePath):
print('--packs.py:setEnvFromEnvFile --1-----------------------------------------------.')
SetEnvPattern = re.compile("^(.*)(=)(.*)$", re.MULTILINE)
SetEnvFile = open(envFilePath, "r")
SetEnvText = SetEnvFile.read()
SetEnvMatchList = re.findall(SetEnvPattern, SetEnvText)
for SetEnvMatch in SetEnvMatchList:
VarName=SetEnvMatch[0]
VarValue=SetEnvMatch[2]
print "-- %s=%s ------"%(VarName,VarValue)
os.environ[VarName]=VarValue
_set_env_from_etc_environment("/etc/environment")`
I also had to add 0.0.0.0 to the NO_PROXY
:
NO_PROXY=localhost,127.0.0.1,0.0.0.0
This allows the command st2 run packs.install packs=st2
to succeed:
action.ref: packs.install
parameters:
packs:
- st2
status: succeeded
start_timestamp: 2016-12-16T00:13:29.299066Z
end_timestamp: 2016-12-16T00:13:47.164410Z
+--------------------------+------------------------+---------------------------+-------------------------+-------------------------------+
| id | status | task | action | start_timestamp |
+--------------------------+------------------------+---------------------------+-------------------------+-------------------------------+
| 5REDACTED----------90b8c | succeeded (7s elapsed) | download pack | packs.download | Fri, 16 Dec 2016 00:13:29 UTC |
| 5REDACTED----------90b8c | succeeded (1s elapsed) | make a prerun | packs.virtualenv_prerun | Fri, 16 Dec 2016 00:13:37 UTC |
| 5REDACTED----------90b8c | succeeded (5s elapsed) | install pack dependencies | packs.setup_virtualenv | Fri, 16 Dec 2016 00:13:38 UTC |
| 5REDACTED----------90b8c | succeeded (3s elapsed) | register pack | packs.load | Fri, 16 Dec 2016 00:13:43 UTC |
+--------------------------+------------------------+---------------------------+-------------------------+-------------------------------+
from st2docs.
Also needed the sudo git config --global http.proxy http://proxy.somecorp.net:8080
for the git clones
from st2docs.
Closing this now that #3137 has been resolved, and updated docs published
from st2docs.
@sidkrishna could you take a look at this one when you get a chance? I'm not sure if the code changes are needed, or just the docs about setting environment variables.
from st2docs.
I saw this issue too. Centos7 and Stackstorm 2.1.0. More info: https://gist.github.com/conor-owens/21d2b291251c9f89ecef579de9fb5221
Seems the various environment variables are not preserved when running the packs.py so the requests doesn't find or use the HTTPS_PROXY environment variable. In my environment sudo -v includes:
"Environment variables to preserve:
ftp_proxy
FTP_PROXY
no_proxy
http_proxy
https_proxy
NO_PROXY
HTTP_PROXY
HTTPS_PROXY"
from st2docs.
Please note #388, that contains a more suitable workaround for st2 pack install
that doesn't require any Python changes and also allows pack dependencies to install as well. Note also that it doesn't address st2 pack search
at all, only pack installation.
I would like to keep this issue open, as we are going to be pursuing a more permanent solution to this problem in a future release.
from st2docs.
Related Issues (20)
- Orquesta not listed on available runners
- make docker-build missing curl
- Some part of captions are missing on the left side navigation menu. HOT 3
- Global RBAC permissions needs to be documented HOT 2
- Use of env variable for actions has no example HOT 1
- Migrate from CircleCI to GH Actions
- Migrate docs.stackstorm.com to GH static pages HOT 10
- StackStorm-HA Docs: Update reference links for Mongo/RabbitMQ dependencies helm charts for accuracy
- Centos 8 EOL HOT 2
- Documented instructions for RBAC role permissions are incorrect HOT 9
- Fix link structure of Orquesta Docs in the docs sidebar HOT 1
- how to solve curl 60 HOT 1
- StackStorm HA `helm install` instructions
- Docs Ubuntu 20.04 HOT 1
- Rules Criteria Documentation Clarification
- Drop Ubuntu 18.04 support
- Drop CentOS7 (RHEL7) support
- Add RockyLinux 9 (RHEL9)
- Add Ubuntu 22.04 support
- Remove all references of CentOS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from st2docs.