I have a Jenkinsfile with some global variables and some stages.
can I update the global variable out from a stage?
An example:
pipeline {
agent any
environment {
PASSWD = "${sh(returnStdout: true, script: 'python -u do_some_something.py')}"
ACC = "HI"
}
stage('stage1') {
when { expression { params.UPDATE_JOB == false } }
steps{
script {
def foo= sh( returnStdout: true, script: 'python -u do_something.py ')
env.ACC = foo
println foo
print("pw")
println env.PASSWD
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
是否ACC可以使用foo中的值更新变量,以便我可以 …
I am struggeling with an error in REHL 7. I have a REHL Image witch is accessible only over SSH key without user/password credentials.
To prevent the password renew process after 90 days (which is not possible with SSH key) I added the no_pass_expiry in my etc/pam.d/password-auth
but then i receive the following error when i try to sudo
pam.d]$ sudo su -
sudo: pam_open_session: System error
sudo: policy plugin failed session initialization
Run Code Online (Sandbox Code Playgroud)
this only occures after the 90 day.
我想缩短并清理 CSV 文件以在 ElasticSearch 中使用它。但某些 Dataframe(单元格)中有换行符,无法将 CSV 解析为 ElasticSearch。我现在用 pandas 缩短了 CSV 并尝试删除换行符,但它不起作用。
代码如下:
import pandas as pd
f=pd.read_csv("test.csv")
keep_col = ["Plugin ID","CVE","CVSS","Risk","Host","Protocol","Port","Name","Synopsis","Description","Solution",]
new_f = f[keep_col].replace('\\n',' ', regex=True)
new_f.to_csv("newFile.csv", index=False)
Run Code Online (Sandbox Code Playgroud)
短缺正在发挥作用,但我在描述、概要和解决方案中添加了换行符。知道如何用 Python / Pandas 解决这个问题吗?CSV 有大约 100k 条目,因此必须在每个条目中删除换行符。