Merge lp:~thomir-deactivatedaccount/juju-viz/fix-box-drawing-for-services into lp:juju-viz

Proposed by Thomi Richards
Status: Merged
Approved by: Haw Loeung
Approved revision: 48
Merge reported by: JuanJo Ciarlante
Merged at revision: not available
Proposed branch: lp:~thomir-deactivatedaccount/juju-viz/fix-box-drawing-for-services
Merge into: lp:juju-viz
Diff against target: 12 lines (+1/-1)
1 file modified
bin/juju-dotty.py (+1/-1)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/juju-viz/fix-box-drawing-for-services
Reviewer Review Type Date Requested Status
JuanJo Ciarlante lgtm Approve
Haw Loeung Approve
Review via email: mp+290390@code.launchpad.net

Description of the change

juju-viz currently checks to see if the service name contains 'db' or the charm name contains 'sql', and if so, renders that service in a box. This is intended to draw database services differently.

However, this fails when services happen to contain 'db' in their name. For example, we deploy services that contain a git commit hash in the service name, which causes juju viz to display some of our services as box when they shouldn't.

This branch changes that logic so the charm name is searched for both the 'db' and 'sql' strings instead.

To post a comment you must log in.
Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM. Searching https://jujucharms.com/q/db, this will also catch influxdb should we ever use that :)

review: Approve
Revision history for this message
JuanJo Ciarlante (jjo) :
review: Approve (lgtm)
Revision history for this message
JuanJo Ciarlante (jjo) wrote :

FYI code comes from http://github.com/jjo/juju-viz, just pushed
this change there, and triggered LP import.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/juju-dotty.py'
2--- bin/juju-dotty.py 2015-10-19 15:49:41 +0000
3+++ bin/juju-dotty.py 2016-03-30 03:35:44 +0000
4@@ -244,7 +244,7 @@
5 if service_dict.get('exposed'):
6 extras.append("shape=house")
7 # hack: if a DB~ish service, use a box
8- if service.find("db") >= 0 or charmname.find("sql") >= 0:
9+ if "sql" in charmname or "db" in charmname:
10 extras.append("shape=box")
11 for unit in units:
12 machine = units[unit]['machine']

Subscribers

People subscribed via source and target branches

to all changes: