小编Mar*_*ohn的帖子

Updating environment global variable in Jenkins pipeline from the stage level - is it possible?

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中的值更新变量,以便我可以 …

groovy jenkins jenkins-pipeline

16
推荐指数
1
解决办法
1万
查看次数

pam_open_session: System error and sudo: policy plugin failed session initialization with no pass expiary in etc/pam.d/password-auth

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.

rhel pam rhel7

3
推荐指数
1
解决办法
2万
查看次数

如何删除 pandas 数据框列中的换行符?

我想缩短并清理 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 条目,因此必须在每个条目中删除换行符。

python csv pandas

3
推荐指数
1
解决办法
3万
查看次数

标签 统计

csv ×1

groovy ×1

jenkins ×1

jenkins-pipeline ×1

pam ×1

pandas ×1

python ×1

rhel ×1

rhel7 ×1