Unknown database instance '{{ name }}'. Are you just guessing?
+{% endif %} +{% endblock %} diff --git a/templates/flavors.html b/templates/flavors.html new file mode 100644 index 0000000..d65cdf6 --- /dev/null +++ b/templates/flavors.html @@ -0,0 +1,47 @@ +{% extends "layout.html" %} + +{% block title %}Flavors - {{ super() }}{% endblock %} + +{% block content %} +| Name | +CPUs | +RAM | +
|---|---|---|
| {{ flavor.name|default('UNKNOWN') }} | +{{ flavor.vcpus|default('-') }} | +{{ flavor.ram|default('-') }}M | +
| Address | +Description | +Mapped to | +DNS names | +
|---|---|---|---|
| {{ floating_ip.address }} | +{{ floating_ip.description }} | ++ {% if floating_ip.target %} + {{ floating_ip.target }} + {% if floating_ip.target_dns %} + ({{ floating_ip.target_dns|join(', ') }}) + {% endif %} + {% else %} + (unused) + {% endif %} + | +
+
|
+
| Name | +Address | +Status | +
|---|---|---|
| {{ lb.name }} | +
+
|
+ + {% if lb.provisioning_status == "ACTIVE" %} + Active, + {% else %} + {{ lb.provisioning_status }}, + {% endif %} + + {% if lb.operating_status == "ONLINE" %} + Online + {% else %} + {{ lb.operating_status }} + {% endif %} + | +
| Name | -Address |
|---|---|
| {{ zone }} | +
| Name | +Size | +Status | +|
|---|---|---|---|
| {{ zone.name }} | +{{ volume.name }} | +{{ volume.size|default('-') }}G | - {% for ip in zone.records %} - {{ ip }} - {% endfor %} + {% if volume.status == "in-use" %} + Attached to + {% for attachment in volume.attachments %} + {% for server in servers %} + {% if server.id == attachment.server_id %} + {% set fqdn = server.name ~ '.' ~ project_name ~ '.eqiad1.wikimedia.cloud' %} + {{ fqdn }} + {% endif %} + {% endfor %} + {% endfor %} + {% elif volume.status == "available" %} + Unattached + {% else %} + {{ volume.status }} + {% endif %} + | +
| Instance name | +Type | +Storage | +Resources | +Status | +||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ database.name }} | +{{ database.datastore.type }} {{ database.datastore.version }} | +{{ database.volume.size|default('-') }}G | ++ {{ flavor.vcpus|default('-') }} CPUs, + {{ flavor.ram|default('-') }}M RAM + | ++ {% if database.status == "ACTIVE" %} + Active, + {% else %} + {{ database.status }}, + {% endif %} + + {% if database.operating_status == "HEALTHY" %} + Healthy + {% else %} + {{ database.operating_status }} + {% endif %} | CPUs | RAM | Storage | +Hypervisor | Last modified | - {% for server in servers|sort(attribute='name') %} + {% for server in servers %} {% set image = images[server.image.id]|default('') %} {% set flavor = flavors[server.flavor.id]|default('') %} - {% set fqdn = server.name ~ '.' ~ project ~ '.eqiad.wmflabs' %} + {% set fqdn = server.name ~ '.' ~ server.project_name ~ '.eqiad1.wikimedia.cloud' %}|||
| {{ fqdn }} | {{ flavor.name|default('UNKNOWN') }} | {{ image.name|default('UNKNOWN') }} | - {% if 'public' in server.addresses %} -{{ server.addresses.public[0].addr }} | - {% else %} -- | +{% for sdn, interfaces in server.addresses.items() %} + {% for interface in interfaces %} + {% if interface['OS-EXT-IPS:type'] == 'fixed' %} + {{ interface.addr }} {% endif %} + {% endfor %} + {% endfor %} | {{ flavor.vcpus|default('-') }} | {{ flavor.ram|default('-') }}M | {{ flavor.disk|default('-') }}G | +{{ server['OS-EXT-SRV-ATTR:hypervisor_hostname'] }} | {{ server.updated }} | ||
| {{ proxy.project }} | +{{ proxy.project_name }} | {{ proxy.domain }} |
{% for backend in proxy.backends %}
@@ -33,10 +33,10 @@
Project: {{ project }}+Project: {{ project }}
User: {{ user.cn }}
+
+ System-wide roles
+
+
+
+
@@ -30,12 +46,13 @@
User: {{ user.cn }}
|
Unknown user '{{ uid }}'. Are you just guessing?
diff --git a/templates/zone.html b/templates/zone.html new file mode 100644 index 0000000..80538e7 --- /dev/null +++ b/templates/zone.html @@ -0,0 +1,129 @@ +{% extends "layout.html" %} + +{% block title %}Zone {{ name }} - {{ super() }}{% endblock %} + +{% block content %} + + +| Name | +Status | +Type | +Target | +
|---|---|---|---|
+ {% if record.name == "@" or record.name == "*" %}
+ {{ record.name }}
+ {% else %}
+ {{ record.name }}
+ {% endif %}
+ |
+ + {% if record.status == "ACTIVE" %} + Active + {% else %} + {{ record.status }} + {% endif %} + | +{{ record.type }} | +
+
|
+
Unknown DNS zone '{{ name }}'. Are you just guessing?
+{% endif %} +{% endblock %} + +{% block css %} + +{% endblock %} +{% block js %} +{{ super() }} + + +{% endblock %} diff --git a/tox.ini b/tox.ini index 140a05a..5dbe735 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,23 @@ [tox] minversion = 1.6 skipsdist = True -envlist = py3 +envlist = py3-{format,pytest} -[testenv] +[testenv:py3-format] commands = + black --check --diff . flake8 - nosetests --with-doctest deps = -r{toxinidir}/requirements.txt + black flake8 - nose + +[testenv:py3-pytest] +commands = pytest -v {posargs} +deps = pytest [flake8] -exclude = .tox +exclude = .tox,venv count = 1 show-pep8 = 1 show-source = 1