Page MenuHomePhabricator

dbctl: instance edit should format all the data in the normal yaml key/value mapping
Open, MediumPublic

Description

The section body is using the json-style k/v mapping, which makes it awkward to add new groups. You either have to continue to work in the json-style, or convert the existing data to yaml-style and then add the new groups.

An example:

1# Editing object codfw/db2124
2host_ip: 10.192.16.19
3note: ''
4port: 3306
5sections:
6 s6: {percentage: 100, pooled: true, weight: 400}

Ideally this should look like:

# Editing object codfw/db2124
host_ip: 10.192.16.19
note: ''
port: 3306
sections:
  s6:
    percentage: 100
    pooled: true
    weight: 400

Event Timeline

I just noticed that if an instance is already in some groups, the formatting is different again:

# Editing object codfw/db2117
host_ip: 10.192.48.34
note: ''
port: 3306
sections:
  s6:
    groups:
      dump: {pooled: true, weight: 100}
      vslow: {pooled: true, weight: 100}
    percentage: 100
    pooled: true
    weight: 300