Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
foreman_wds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LiU IT - Infrastructure
foreman_wds
Commits
ff67e09a
Verified
Commit
ff67e09a
authored
4 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Update rendering code to be 2.0
parent
595f5989
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/concerns/foreman_wds/unattended_controller_extensions.rb
+6
-10
6 additions, 10 deletions
.../concerns/foreman_wds/unattended_controller_extensions.rb
with
6 additions
and
10 deletions
app/controllers/concerns/foreman_wds/unattended_controller_extensions.rb
+
6
−
10
View file @
ff67e09a
...
@@ -6,25 +6,21 @@ module ForemanWds
...
@@ -6,25 +6,21 @@ module ForemanWds
super
super
end
end
def
load_template_vars
super
unless
params
[
:kind
]
==
'wds_localboot'
end
private
private
def
wds_render_csr
def
wds_render_csr
return
render
(
:plain
=>
'Host not in build mode'
)
unless
@host
and
@host
.
build?
return
unless
verify_found_host
return
head
(
:method_not_allowed
)
unless
allowed_to_install?
template
=
ProvisioningTemplate
.
find_by_name
(
'csr_attributes.yaml'
)
template
=
ProvisioningTemplate
.
find_by_name
(
'csr_attributes.yaml'
)
return
safe_render
(
template
)
if
template
content
=
@host
.
render_template
template:
template
return
head
(
:not_found
)
raise
Foreman
::
Exception
.
new
(
N_
(
"Template '%s' didn't render correctly"
),
template
.
name
)
unless
content
render
plain:
content
end
end
def
wds_deploy_localboot
def
wds_deploy_localboot
return
render
(
:plain
=>
'Host not in build mode'
)
unless
@host
and
@host
.
build?
return
unless
verify_found_host
return
head
(
:method_not_allowed
)
unless
allowed_to_install?
iface
=
@host
.
provision_interface
iface
=
@host
.
provision_interface
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment