Skip to content

Commit eeefe5c

Browse files
authored
Merge pull request #1750 from jrha/indentation-ceph
ncm-ceph: Cleanup pan templates
2 parents 16e8f54 + ad4945a commit eeefe5c

File tree

8 files changed

+76
-69
lines changed

8 files changed

+76
-69
lines changed

ncm-ceph/src/main/resources/tests/profiles/basic_crushmap.pan

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ variable BASE_STEPS = list(
55
'take', 'default',
66
'set_chooseleaf_tries', 5,
77
'choices', list(
8-
dict(
9-
'chtype', 'chooseleaf firstn',
10-
'number', 0,
11-
'bktype', 'host',
8+
dict(
9+
'chtype', 'chooseleaf firstn',
10+
'number', 0,
11+
'bktype', 'host',
1212
),
1313
),
1414
),
Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
object template basic_cluster;
22

33

4-
variable OSDS = dict (
5-
'ceph001', dict (
4+
variable CEPH_OSDS = dict(
5+
'ceph001', dict(
66
'fqdn', 'ceph001.cubone.os',
77
'osds', dict(
88
escape('/var/lib/ceph/osd/sdc'), dict(),
99
'sdd', dict(
1010
'journal_path', '/var/lib/ceph/log/sda4/osd-sdd/journal'
11-
)
1211
)
13-
),
14-
'ceph002', dict (
12+
)
13+
),
14+
'ceph002', dict(
1515
'fqdn', 'ceph002.cubone.os',
1616
'osds', dict(
1717
'sdc', dict(
18-
'journal_path', '/var/lib/ceph/log/sda4/osd-sdc/journal'
18+
'journal_path', '/var/lib/ceph/log/sda4/osd-sdc/journal'
1919
)
2020
)
2121
)
2222
);
2323

24-
variable MDSS = dict (
24+
variable CEPH_MDSS = dict(
2525
'ceph002', dict(
2626
'fqdn', 'ceph002.cubone.os',
2727
'up', true
@@ -40,23 +40,23 @@ variable MONITOR3 = dict(
4040
'up', true,
4141
);
4242

43-
variable CONFIG = dict (
43+
variable CONFIG = dict(
4444
'fsid' , 'a94f9906-ff68-487d-8193-23ad04c1b5c4',
4545
'mon_initial_members', list ('ceph001', 'ceph002', 'ceph003')
4646
);
4747

4848
prefix '/software/components/ceph/clusters';
4949

50-
'ceph' = dict (
50+
'ceph' = dict(
5151
'config', CONFIG,
52-
'osdhosts', OSDS,
53-
'mdss', MDSS,
54-
'monitors', dict (
52+
'osdhosts', CEPH_OSDS,
53+
'mdss', CEPH_MDSS,
54+
'monitors', dict(
5555
'ceph001', MONITOR1,
5656
'ceph002', MONITOR2,
5757
'ceph003', MONITOR3
5858
),
59-
'deployhosts', dict (
59+
'deployhosts', dict(
6060
'ceph002', 'ceph002.cubone.os'
6161
)
6262

@@ -67,6 +67,10 @@ prefix '/software/components/ceph/clusters';
6767
'/system/network/hostname' = 'ceph003';
6868
'/system/network/domainname' = 'cubone.os';
6969

70-
'/software/components/accounts/users/ceph' =
71-
dict('homeDir', '/tmp', 'gid', '111' );
72-
'/software/components/accounts/groups/ceph' = dict('gid', '111');
70+
'/software/components/accounts/users/ceph' = dict(
71+
'homeDir', '/tmp',
72+
'gid', '111',
73+
);
74+
'/software/components/accounts/groups/ceph' = dict(
75+
'gid', '111',
76+
);

ncm-ceph/src/test/resources/basic_crushmap.pan

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ variable CEPH_OSD_DISKS = list('sdc', 'sdd', 'sde', 'sdf', 'sdg', 'sdh', 'sdi',
99
variable CEPH_JOURNAL_DISKS = list('sda4', 'sdb');
1010
variable CEPH_DEFAULT_OSD_WEIGHT = 1.0;
1111

12-
variable MDSS = dict (
12+
variable CEPH_MDSS = dict(
1313
'ceph001.cubone.os', dict(
1414
'fqdn', 'ceph001.cubone.os',
15-
),
15+
),
1616
'ceph002.cubone.os', dict(
1717
'fqdn', 'ceph002.cubone.os',
1818
)
@@ -30,7 +30,7 @@ variable MONITOR3 = dict(
3030
'fqdn', 'ceph003.cubone.os',
3131
);
3232

33-
variable CONFIG = dict (
33+
variable CONFIG = dict(
3434
'fsid' , '82766e04-585b-49a6-a0ac-c13d9ffd0a7d',
3535
'mon_initial_members', list ('ceph001', 'ceph002', 'ceph003'),
3636
'public_network', '10.141.8.0/20',
@@ -50,16 +50,16 @@ variable BASE_STEPS = list(
5050
dict(
5151
'take', 'default',
5252
'choices', list(
53-
dict(
54-
'chtype', 'chooseleaf firstn',
55-
'bktype', 'host',
56-
'number', 0,
53+
dict(
54+
'chtype', 'chooseleaf firstn',
55+
'bktype', 'host',
56+
'number', 0,
5757
),
5858
),
5959
),
6060
);
6161

62-
prefix "/software/components/ceph/clusters/ceph/crushmap/";
62+
prefix "/software/components/ceph/clusters/ceph/crushmap";
6363

6464
'types' = list('osd', 'host', 'root');
6565

@@ -103,11 +103,11 @@ prefix "/software/components/ceph/clusters/ceph/crushmap/";
103103
prefix '/software/components/ceph/clusters/ceph';
104104
'config' = CONFIG;
105105
'osdhosts' = {
106-
t=dict();
107-
foreach(idx;host;CEPH_HOSTS) {
106+
t = dict();
107+
foreach(idx; host; CEPH_HOSTS) {
108108
d = dict();
109-
foreach(odx;disk;CEPH_OSD_DISKS) {
110-
jdx= odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks
109+
foreach(odx; disk; CEPH_OSD_DISKS) {
110+
jdx = odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks
111111
d[disk] = dict(
112112
'journal_path', format('/var/lib/ceph/log/%s/osd-%s/journal', CEPH_JOURNAL_DISKS[jdx], disk),
113113
'crush_weight', CEPH_DEFAULT_OSD_WEIGHT
@@ -121,12 +121,12 @@ prefix '/software/components/ceph/clusters/ceph';
121121
t;
122122
};
123123

124-
'mdss' = MDSS;
125-
'monitors' = dict (
124+
'mdss' = CEPH_MDSS;
125+
'monitors' = dict(
126126
'ceph001', MONITOR1,
127127
'ceph002', MONITOR2,
128128
'ceph003', MONITOR3
129129
);
130-
'deployhosts' = dict (
130+
'deployhosts' = dict(
131131
'ceph001', 'ceph001.cubone.os',
132132
);

ncm-ceph/src/test/resources/basic_crushmap_tt.pan

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ variable CEPH_OSD_DISKS = list('sdc', 'sdd', 'sde', 'sdf', 'sdg', 'sdh', 'sdi',
88
variable CEPH_JOURNAL_DISKS = list('sda4', 'sdb');
99
variable CEPH_DEFAULT_OSD_WEIGHT = 1.0;
1010

11-
variable MDSS = dict (
11+
variable CEPH_MDSS = dict (
1212
'ceph001.cubone.os', dict(
1313
'fqdn', 'ceph001.cubone.os',
14-
),
14+
),
1515
'ceph002.cubone.os', dict(
1616
'fqdn', 'ceph002.cubone.os',
1717
)
@@ -48,16 +48,16 @@ variable BASE_STEPS = list(
4848
dict(
4949
'take', 'default',
5050
'choices', list(
51-
dict(
52-
'chtype', 'chooseleaf firstn',
53-
'bktype', 'host',
51+
dict(
52+
'chtype', 'chooseleaf firstn',
53+
'bktype', 'host',
5454
),
5555
),
5656
),
5757
);
5858

5959

60-
prefix "/software/components/ceph/clusters/ceph/crushmap/";
60+
prefix "/software/components/ceph/clusters/ceph/crushmap";
6161

6262
'types' = list('osd', 'host', 'root');
6363

@@ -94,11 +94,11 @@ prefix "/software/components/ceph/clusters/ceph/crushmap/";
9494
prefix '/software/components/ceph/clusters/ceph';
9595
'config' = CONFIG;
9696
'osdhosts' = {
97-
t=dict();
98-
foreach(idx;host;CEPH_HOSTS) {
97+
t = dict();
98+
foreach(idx; host; CEPH_HOSTS) {
9999
d = dict();
100-
foreach(odx;disk;CEPH_OSD_DISKS) {
101-
jdx= odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks
100+
foreach(odx; disk; CEPH_OSD_DISKS) {
101+
jdx = odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks
102102
d[disk] = dict(
103103
'journal_path', format('/var/lib/ceph/log/%s/osd-%s/journal', CEPH_JOURNAL_DISKS[jdx], disk),
104104
'crush_weight', CEPH_DEFAULT_OSD_WEIGHT
@@ -112,7 +112,7 @@ prefix '/software/components/ceph/clusters/ceph';
112112
t;
113113
};
114114

115-
'mdss' = MDSS;
115+
'mdss' = CEPH_MDSS;
116116
'monitors' = dict (
117117
'ceph001', MONITOR1,
118118
'ceph002', MONITOR2,

ncm-ceph/src/test/resources/basic_radosgw.pan

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,5 @@ prefix '/software/components/ceph/clusters';
4040
'/system/network/hostname' = 'ceph002';
4141
'/system/network/domainname' = 'cubone.os';
4242

43-
'/software/components/accounts/users/ceph' =
44-
dict('homeDir', '/tmp', 'gid', '111' );
43+
'/software/components/accounts/users/ceph' = dict('homeDir', '/tmp', 'gid', '111');
4544
'/software/components/accounts/groups/ceph' = dict('gid', '111');

ncm-ceph/src/test/resources/labeled_crushmap.pan

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ variable CEPH_OSD_DISKS = list('sdc', 'sdd', 'sde', 'sdf', 'sdg', 'sdh', 'sdi',
1010
variable CEPH_JOURNAL_DISKS = list('sda4', 'sdb');
1111
variable CEPH_DEFAULT_OSD_WEIGHT = 1.0;
1212

13-
variable MDSS = dict (
13+
variable CEPH_MDSS = dict (
1414
'ceph001.cubone.os', dict(
1515
'fqdn', 'ceph001.cubone.os',
16-
),
16+
),
1717
'ceph002.cubone.os', dict(
1818
'fqdn', 'ceph002.cubone.os',
1919
)
@@ -51,16 +51,16 @@ variable BASE_STEPS = list(
5151
dict(
5252
'take', 'default',
5353
'choices', list(
54-
dict(
55-
'chtype', 'chooseleaf firstn',
56-
'bktype', 'host',
57-
'number', 0,
54+
dict(
55+
'chtype', 'chooseleaf firstn',
56+
'bktype', 'host',
57+
'number', 0,
5858
),
5959
),
6060
),
6161
);
6262

63-
prefix "/software/components/ceph/clusters/ceph/crushmap/";
63+
prefix "/software/components/ceph/clusters/ceph/crushmap";
6464

6565
'types' = list('osd', 'host', 'root');
6666

@@ -104,13 +104,13 @@ prefix "/software/components/ceph/clusters/ceph/crushmap/";
104104
prefix '/software/components/ceph/clusters/ceph';
105105
'config' = CONFIG;
106106
'osdhosts' = {
107-
t=dict();
108-
foreach(idx;host;CEPH_HOSTS) {
107+
t = dict();
108+
foreach(idx; host; CEPH_HOSTS) {
109109
d = dict();
110-
foreach(odx;disk;CEPH_OSD_DISKS) {
111-
jdx= odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks
110+
foreach(odx; disk; CEPH_OSD_DISKS) {
111+
jdx = odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks
112112
if (host == 'ceph003') {
113-
jdx=0; # Empty bucket tst-1 on ceph003
113+
jdx = 0; # Empty bucket tst-1 on ceph003
114114
};
115115
d[disk] = dict(
116116
'journal_path', format('/var/lib/ceph/log/%s/osd-%s/journal', CEPH_JOURNAL_DISKS[jdx], disk),
@@ -126,7 +126,7 @@ prefix '/software/components/ceph/clusters/ceph';
126126
t;
127127
};
128128

129-
'mdss' = MDSS;
129+
'mdss' = CEPH_MDSS;
130130
'monitors' = dict (
131131
'ceph001', MONITOR1,
132132
'ceph002', MONITOR2,

ncm-ceph/src/test/resources/tcfgfile.pan

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ prefix '/software/components/ceph/config';
1818
'rgw/client.rgw.test' = dict(
1919
'host', 'host3',
2020
'keyring', 'keyfile',
21-
'rgw_dns_name', 'host3.aaa.be');
21+
'rgw_dns_name', 'host3.aaa.be',
22+
);

ncm-ceph/src/test/resources/tcluster.pan

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
template tcluster;
22

3-
variable MDS_NODES = dict (
3+
variable MDS_NODES = dict(
44
'ceph002', dict(
55
'fqdn', 'ceph002.cubone.os',
66
),
@@ -27,12 +27,12 @@ bind '/software/components/ceph' = ceph_component;
2727
prefix '/software/components/ceph/cluster';
2828

2929
'mdss' = MDS_NODES;
30-
'monitors' = dict (
30+
'monitors' = dict(
3131
'ceph001', MONITOR1,
3232
'ceph002', MONITOR2,
3333
'ceph003', MONITOR3
3434
);
35-
'deployhosts' = dict (
35+
'deployhosts' = dict(
3636
'ceph002', 'ceph002.cubone.os'
3737
);
3838
'ssh_multiplex' = true;
@@ -57,7 +57,10 @@ prefix 'configdb';
5757
'/system/network/hostname' = 'ceph002';
5858
'/system/network/domainname' = 'cubone.os';
5959

60-
'/software/components/accounts/users/ceph' =
61-
dict('homeDir', '/tmp', 'gid', '167' );
62-
'/software/components/accounts/groups/ceph' = dict('gid', '167');
63-
60+
'/software/components/accounts/users/ceph' = dict(
61+
'homeDir', '/tmp',
62+
'gid', '167',
63+
);
64+
'/software/components/accounts/groups/ceph' = dict(
65+
'gid', '167',
66+
);

0 commit comments

Comments
 (0)