Fix authorization property issue
The change fixes a XML generating error (KeyError: '_use_folder_perms') for project, which isn't contained in a folder and has got authorization properties. Task: 38110 Story: 2007087 Change-Id: I2e0ec6e524d07a935333b35e10eb4204af9256f7
This commit is contained in:
parent
9797703801
commit
ad94757a4a
@ -510,7 +510,7 @@ def authorization(registry, xml_parent, data):
|
||||
"""
|
||||
|
||||
# get the folder name if it exists
|
||||
in_a_folder = data.pop("_use_folder_perms")
|
||||
in_a_folder = data.pop("_use_folder_perms", None) if data else None
|
||||
|
||||
credentials = "com.cloudbees.plugins.credentials.CredentialsProvider."
|
||||
ownership = "com.synopsys.arc.jenkins.plugins.ownership.OwnershipPlugin."
|
||||
|
23
tests/yamlparser/fixtures/project-with-auth-properties.xml
Normal file
23
tests/yamlparser/fixtures/project-with-auth-properties.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.cloudbees.hudson.plugins.folder.Folder plugin="cloudbees-folder">
|
||||
<icon class="com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon"/>
|
||||
<views/>
|
||||
<viewsTabBar class="hudson.views.DefaultViewsTabBar"/>
|
||||
<primaryView>All</primaryView>
|
||||
<healthMetrics/>
|
||||
<actions/>
|
||||
<description><!-- Managed by Jenkins Job Builder --></description>
|
||||
<keepDependencies>false</keepDependencies>
|
||||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
|
||||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
|
||||
<concurrentBuild>false</concurrentBuild>
|
||||
<canRoam>true</canRoam>
|
||||
<properties>
|
||||
<hudson.security.AuthorizationMatrixProperty>
|
||||
<permission>hudson.model.Item.Build:auser</permission>
|
||||
</hudson.security.AuthorizationMatrixProperty>
|
||||
</properties>
|
||||
<scm class="hudson.scm.NullSCM"/>
|
||||
<publishers/>
|
||||
<buildWrappers/>
|
||||
</com.cloudbees.hudson.plugins.folder.Folder>
|
12
tests/yamlparser/fixtures/project-with-auth-properties.yaml
Normal file
12
tests/yamlparser/fixtures/project-with-auth-properties.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
- property:
|
||||
name: auth-prop-test
|
||||
properties:
|
||||
- authorization:
|
||||
auser:
|
||||
- job-build
|
||||
|
||||
- job:
|
||||
name: auth-job-test
|
||||
project-type: folder
|
||||
properties:
|
||||
- auth-prop-test
|
Loading…
x
Reference in New Issue
Block a user