remove html preview mode
This commit is contained in:
parent
f10bacfa16
commit
581f0ca353
|
@ -121,16 +121,14 @@ class AppWeb(object):
|
|||
# raise cherrypy.HTTPRedirect('feed', 302)
|
||||
|
||||
@cherrypy.expose
|
||||
def puppet(self, fqdn, preview=False):
|
||||
def puppet(self, fqdn):
|
||||
with self.nodes.db.transaction() as c:
|
||||
node = c.root.nodes[fqdn]
|
||||
doc = {"environment": "production",
|
||||
"classes": {cls.name: yaml.load(conf) or {} for cls, conf in recurse_classes(node).items()},
|
||||
"parameters": recurse_params(node)}
|
||||
if preview:
|
||||
yield "<plaintext>"
|
||||
yield "---\n"
|
||||
yield yamldump(doc)
|
||||
cherrypy.response.headers["Content-type"] = "text/plain"
|
||||
return "---\n" + yamldump(doc)
|
||||
|
||||
@cherrypy.expose
|
||||
def login(self):
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</form>-->
|
||||
<a href="/node_edit?node={{ node.fqdn }}"><button class="secondary-button pure-button">Edit</button></a>
|
||||
<a href="/node/{{ node.fqdn }}/attach"><button class="secondary-button pure-button">Attach class</button></a>
|
||||
<a href="/puppet?preview=true&fqdn={{ node.fqdn }}"><button class="secondary-button pure-button">Render</button></a>
|
||||
<a href="/puppet?fqdn={{ node.fqdn }}"><button class="secondary-button pure-button">Render</button></a>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
|
|
Loading…
Reference in New Issue