From 429578b7a42e1d146d3629046156bade21dc45a7 Mon Sep 17 00:00:00 2001 From: James Adams Date: Thu, 28 Nov 2024 14:22:26 +0000 Subject: [PATCH 1/2] ncm-ceph: Fix wrapping and indentation in pan --- .../tests/profiles/basic_crushmap.pan | 8 ++--- ncm-ceph/src/test/resources/basic_cluster.pan | 32 +++++++++++-------- .../src/test/resources/basic_crushmap.pan | 18 +++++------ .../src/test/resources/basic_crushmap_tt.pan | 8 ++--- ncm-ceph/src/test/resources/basic_radosgw.pan | 3 +- .../src/test/resources/labeled_crushmap.pan | 10 +++--- ncm-ceph/src/test/resources/tcfgfile.pan | 3 +- ncm-ceph/src/test/resources/tcluster.pan | 17 ++++++---- 8 files changed, 53 insertions(+), 46 deletions(-) diff --git a/ncm-ceph/src/main/resources/tests/profiles/basic_crushmap.pan b/ncm-ceph/src/main/resources/tests/profiles/basic_crushmap.pan index b22d756e15..c01ecd6b73 100644 --- a/ncm-ceph/src/main/resources/tests/profiles/basic_crushmap.pan +++ b/ncm-ceph/src/main/resources/tests/profiles/basic_crushmap.pan @@ -5,10 +5,10 @@ variable BASE_STEPS = list( 'take', 'default', 'set_chooseleaf_tries', 5, 'choices', list( - dict( - 'chtype', 'chooseleaf firstn', - 'number', 0, - 'bktype', 'host', + dict( + 'chtype', 'chooseleaf firstn', + 'number', 0, + 'bktype', 'host', ), ), ), diff --git a/ncm-ceph/src/test/resources/basic_cluster.pan b/ncm-ceph/src/test/resources/basic_cluster.pan index 2a6f96f743..78fe803e95 100644 --- a/ncm-ceph/src/test/resources/basic_cluster.pan +++ b/ncm-ceph/src/test/resources/basic_cluster.pan @@ -1,27 +1,27 @@ object template basic_cluster; -variable OSDS = dict ( - 'ceph001', dict ( +variable OSDS = dict( + 'ceph001', dict( 'fqdn', 'ceph001.cubone.os', 'osds', dict( escape('/var/lib/ceph/osd/sdc'), dict(), 'sdd', dict( 'journal_path', '/var/lib/ceph/log/sda4/osd-sdd/journal' - ) ) - ), - 'ceph002', dict ( + ) + ), + 'ceph002', dict( 'fqdn', 'ceph002.cubone.os', 'osds', dict( 'sdc', dict( - 'journal_path', '/var/lib/ceph/log/sda4/osd-sdc/journal' + 'journal_path', '/var/lib/ceph/log/sda4/osd-sdc/journal' ) ) ) ); -variable MDSS = dict ( +variable MDSS = dict( 'ceph002', dict( 'fqdn', 'ceph002.cubone.os', 'up', true @@ -40,23 +40,23 @@ variable MONITOR3 = dict( 'up', true, ); -variable CONFIG = dict ( +variable CONFIG = dict( 'fsid' , 'a94f9906-ff68-487d-8193-23ad04c1b5c4', 'mon_initial_members', list ('ceph001', 'ceph002', 'ceph003') ); prefix '/software/components/ceph/clusters'; -'ceph' = dict ( +'ceph' = dict( 'config', CONFIG, 'osdhosts', OSDS, 'mdss', MDSS, - 'monitors', dict ( + 'monitors', dict( 'ceph001', MONITOR1, 'ceph002', MONITOR2, 'ceph003', MONITOR3 ), - 'deployhosts', dict ( + 'deployhosts', dict( 'ceph002', 'ceph002.cubone.os' ) @@ -67,6 +67,10 @@ prefix '/software/components/ceph/clusters'; '/system/network/hostname' = 'ceph003'; '/system/network/domainname' = 'cubone.os'; -'/software/components/accounts/users/ceph' = - dict('homeDir', '/tmp', 'gid', '111' ); -'/software/components/accounts/groups/ceph' = dict('gid', '111'); +'/software/components/accounts/users/ceph' = dict( + 'homeDir', '/tmp', + 'gid', '111', +); +'/software/components/accounts/groups/ceph' = dict( + 'gid', '111', +); diff --git a/ncm-ceph/src/test/resources/basic_crushmap.pan b/ncm-ceph/src/test/resources/basic_crushmap.pan index 13258762d8..74777d0db5 100644 --- a/ncm-ceph/src/test/resources/basic_crushmap.pan +++ b/ncm-ceph/src/test/resources/basic_crushmap.pan @@ -9,10 +9,10 @@ variable CEPH_OSD_DISKS = list('sdc', 'sdd', 'sde', 'sdf', 'sdg', 'sdh', 'sdi', variable CEPH_JOURNAL_DISKS = list('sda4', 'sdb'); variable CEPH_DEFAULT_OSD_WEIGHT = 1.0; -variable MDSS = dict ( +variable MDSS = dict( 'ceph001.cubone.os', dict( 'fqdn', 'ceph001.cubone.os', - ), + ), 'ceph002.cubone.os', dict( 'fqdn', 'ceph002.cubone.os', ) @@ -30,7 +30,7 @@ variable MONITOR3 = dict( 'fqdn', 'ceph003.cubone.os', ); -variable CONFIG = dict ( +variable CONFIG = dict( 'fsid' , '82766e04-585b-49a6-a0ac-c13d9ffd0a7d', 'mon_initial_members', list ('ceph001', 'ceph002', 'ceph003'), 'public_network', '10.141.8.0/20', @@ -50,10 +50,10 @@ variable BASE_STEPS = list( dict( 'take', 'default', 'choices', list( - dict( - 'chtype', 'chooseleaf firstn', - 'bktype', 'host', - 'number', 0, + dict( + 'chtype', 'chooseleaf firstn', + 'bktype', 'host', + 'number', 0, ), ), ), @@ -122,11 +122,11 @@ prefix '/software/components/ceph/clusters/ceph'; }; 'mdss' = MDSS; -'monitors' = dict ( +'monitors' = dict( 'ceph001', MONITOR1, 'ceph002', MONITOR2, 'ceph003', MONITOR3 ); -'deployhosts' = dict ( +'deployhosts' = dict( 'ceph001', 'ceph001.cubone.os', ); diff --git a/ncm-ceph/src/test/resources/basic_crushmap_tt.pan b/ncm-ceph/src/test/resources/basic_crushmap_tt.pan index ba6e4fc9e8..46a147cae9 100644 --- a/ncm-ceph/src/test/resources/basic_crushmap_tt.pan +++ b/ncm-ceph/src/test/resources/basic_crushmap_tt.pan @@ -11,7 +11,7 @@ variable CEPH_DEFAULT_OSD_WEIGHT = 1.0; variable MDSS = dict ( 'ceph001.cubone.os', dict( 'fqdn', 'ceph001.cubone.os', - ), + ), 'ceph002.cubone.os', dict( 'fqdn', 'ceph002.cubone.os', ) @@ -48,9 +48,9 @@ variable BASE_STEPS = list( dict( 'take', 'default', 'choices', list( - dict( - 'chtype', 'chooseleaf firstn', - 'bktype', 'host', + dict( + 'chtype', 'chooseleaf firstn', + 'bktype', 'host', ), ), ), diff --git a/ncm-ceph/src/test/resources/basic_radosgw.pan b/ncm-ceph/src/test/resources/basic_radosgw.pan index 0e781b0422..f03963bcc7 100644 --- a/ncm-ceph/src/test/resources/basic_radosgw.pan +++ b/ncm-ceph/src/test/resources/basic_radosgw.pan @@ -40,6 +40,5 @@ prefix '/software/components/ceph/clusters'; '/system/network/hostname' = 'ceph002'; '/system/network/domainname' = 'cubone.os'; -'/software/components/accounts/users/ceph' = - dict('homeDir', '/tmp', 'gid', '111' ); +'/software/components/accounts/users/ceph' = dict('homeDir', '/tmp', 'gid', '111'); '/software/components/accounts/groups/ceph' = dict('gid', '111'); diff --git a/ncm-ceph/src/test/resources/labeled_crushmap.pan b/ncm-ceph/src/test/resources/labeled_crushmap.pan index 0a21a8b88a..cd4973eaee 100644 --- a/ncm-ceph/src/test/resources/labeled_crushmap.pan +++ b/ncm-ceph/src/test/resources/labeled_crushmap.pan @@ -13,7 +13,7 @@ variable CEPH_DEFAULT_OSD_WEIGHT = 1.0; variable MDSS = dict ( 'ceph001.cubone.os', dict( 'fqdn', 'ceph001.cubone.os', - ), + ), 'ceph002.cubone.os', dict( 'fqdn', 'ceph002.cubone.os', ) @@ -51,10 +51,10 @@ variable BASE_STEPS = list( dict( 'take', 'default', 'choices', list( - dict( - 'chtype', 'chooseleaf firstn', - 'bktype', 'host', - 'number', 0, + dict( + 'chtype', 'chooseleaf firstn', + 'bktype', 'host', + 'number', 0, ), ), ), diff --git a/ncm-ceph/src/test/resources/tcfgfile.pan b/ncm-ceph/src/test/resources/tcfgfile.pan index a8d031908d..7cb95134a9 100644 --- a/ncm-ceph/src/test/resources/tcfgfile.pan +++ b/ncm-ceph/src/test/resources/tcfgfile.pan @@ -18,4 +18,5 @@ prefix '/software/components/ceph/config'; 'rgw/client.rgw.test' = dict( 'host', 'host3', 'keyring', 'keyfile', - 'rgw_dns_name', 'host3.aaa.be'); + 'rgw_dns_name', 'host3.aaa.be', +); diff --git a/ncm-ceph/src/test/resources/tcluster.pan b/ncm-ceph/src/test/resources/tcluster.pan index 81f7d2c228..19cdf03766 100644 --- a/ncm-ceph/src/test/resources/tcluster.pan +++ b/ncm-ceph/src/test/resources/tcluster.pan @@ -1,6 +1,6 @@ template tcluster; -variable MDS_NODES = dict ( +variable MDS_NODES = dict( 'ceph002', dict( 'fqdn', 'ceph002.cubone.os', ), @@ -27,12 +27,12 @@ bind '/software/components/ceph' = ceph_component; prefix '/software/components/ceph/cluster'; 'mdss' = MDS_NODES; -'monitors' = dict ( +'monitors' = dict( 'ceph001', MONITOR1, 'ceph002', MONITOR2, 'ceph003', MONITOR3 ); -'deployhosts' = dict ( +'deployhosts' = dict( 'ceph002', 'ceph002.cubone.os' ); 'ssh_multiplex' = true; @@ -57,7 +57,10 @@ prefix 'configdb'; '/system/network/hostname' = 'ceph002'; '/system/network/domainname' = 'cubone.os'; -'/software/components/accounts/users/ceph' = - dict('homeDir', '/tmp', 'gid', '167' ); -'/software/components/accounts/groups/ceph' = dict('gid', '167'); - +'/software/components/accounts/users/ceph' = dict( + 'homeDir', '/tmp', + 'gid', '167', +); +'/software/components/accounts/groups/ceph' = dict( + 'gid', '167', +); From ad4945ad8b4ceeb7e96da19e8c1f4c4df35d0dc1 Mon Sep 17 00:00:00 2001 From: James Adams Date: Thu, 28 Nov 2024 16:51:06 +0000 Subject: [PATCH 2/2] ncm-ceph: Cleanup lint from test templates --- ncm-ceph/src/test/resources/basic_cluster.pan | 8 ++++---- ncm-ceph/src/test/resources/basic_crushmap.pan | 14 +++++++------- .../src/test/resources/basic_crushmap_tt.pan | 14 +++++++------- ncm-ceph/src/test/resources/labeled_crushmap.pan | 16 ++++++++-------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ncm-ceph/src/test/resources/basic_cluster.pan b/ncm-ceph/src/test/resources/basic_cluster.pan index 78fe803e95..9cfa1a01ab 100644 --- a/ncm-ceph/src/test/resources/basic_cluster.pan +++ b/ncm-ceph/src/test/resources/basic_cluster.pan @@ -1,7 +1,7 @@ object template basic_cluster; -variable OSDS = dict( +variable CEPH_OSDS = dict( 'ceph001', dict( 'fqdn', 'ceph001.cubone.os', 'osds', dict( @@ -21,7 +21,7 @@ variable OSDS = dict( ) ); -variable MDSS = dict( +variable CEPH_MDSS = dict( 'ceph002', dict( 'fqdn', 'ceph002.cubone.os', 'up', true @@ -49,8 +49,8 @@ prefix '/software/components/ceph/clusters'; 'ceph' = dict( 'config', CONFIG, - 'osdhosts', OSDS, - 'mdss', MDSS, + 'osdhosts', CEPH_OSDS, + 'mdss', CEPH_MDSS, 'monitors', dict( 'ceph001', MONITOR1, 'ceph002', MONITOR2, diff --git a/ncm-ceph/src/test/resources/basic_crushmap.pan b/ncm-ceph/src/test/resources/basic_crushmap.pan index 74777d0db5..0dbb42996a 100644 --- a/ncm-ceph/src/test/resources/basic_crushmap.pan +++ b/ncm-ceph/src/test/resources/basic_crushmap.pan @@ -9,7 +9,7 @@ variable CEPH_OSD_DISKS = list('sdc', 'sdd', 'sde', 'sdf', 'sdg', 'sdh', 'sdi', variable CEPH_JOURNAL_DISKS = list('sda4', 'sdb'); variable CEPH_DEFAULT_OSD_WEIGHT = 1.0; -variable MDSS = dict( +variable CEPH_MDSS = dict( 'ceph001.cubone.os', dict( 'fqdn', 'ceph001.cubone.os', ), @@ -59,7 +59,7 @@ variable BASE_STEPS = list( ), ); -prefix "/software/components/ceph/clusters/ceph/crushmap/"; +prefix "/software/components/ceph/clusters/ceph/crushmap"; 'types' = list('osd', 'host', 'root'); @@ -103,11 +103,11 @@ prefix "/software/components/ceph/clusters/ceph/crushmap/"; prefix '/software/components/ceph/clusters/ceph'; 'config' = CONFIG; 'osdhosts' = { - t=dict(); - foreach(idx;host;CEPH_HOSTS) { + t = dict(); + foreach(idx; host; CEPH_HOSTS) { d = dict(); - foreach(odx;disk;CEPH_OSD_DISKS) { - jdx= odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks + foreach(odx; disk; CEPH_OSD_DISKS) { + jdx = odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks d[disk] = dict( 'journal_path', format('/var/lib/ceph/log/%s/osd-%s/journal', CEPH_JOURNAL_DISKS[jdx], disk), 'crush_weight', CEPH_DEFAULT_OSD_WEIGHT @@ -121,7 +121,7 @@ prefix '/software/components/ceph/clusters/ceph'; t; }; -'mdss' = MDSS; +'mdss' = CEPH_MDSS; 'monitors' = dict( 'ceph001', MONITOR1, 'ceph002', MONITOR2, diff --git a/ncm-ceph/src/test/resources/basic_crushmap_tt.pan b/ncm-ceph/src/test/resources/basic_crushmap_tt.pan index 46a147cae9..e6097eaa66 100644 --- a/ncm-ceph/src/test/resources/basic_crushmap_tt.pan +++ b/ncm-ceph/src/test/resources/basic_crushmap_tt.pan @@ -8,7 +8,7 @@ variable CEPH_OSD_DISKS = list('sdc', 'sdd', 'sde', 'sdf', 'sdg', 'sdh', 'sdi', variable CEPH_JOURNAL_DISKS = list('sda4', 'sdb'); variable CEPH_DEFAULT_OSD_WEIGHT = 1.0; -variable MDSS = dict ( +variable CEPH_MDSS = dict ( 'ceph001.cubone.os', dict( 'fqdn', 'ceph001.cubone.os', ), @@ -57,7 +57,7 @@ variable BASE_STEPS = list( ); -prefix "/software/components/ceph/clusters/ceph/crushmap/"; +prefix "/software/components/ceph/clusters/ceph/crushmap"; 'types' = list('osd', 'host', 'root'); @@ -94,11 +94,11 @@ prefix "/software/components/ceph/clusters/ceph/crushmap/"; prefix '/software/components/ceph/clusters/ceph'; 'config' = CONFIG; 'osdhosts' = { - t=dict(); - foreach(idx;host;CEPH_HOSTS) { + t = dict(); + foreach(idx; host; CEPH_HOSTS) { d = dict(); - foreach(odx;disk;CEPH_OSD_DISKS) { - jdx= odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks + foreach(odx; disk; CEPH_OSD_DISKS) { + jdx = odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks d[disk] = dict( 'journal_path', format('/var/lib/ceph/log/%s/osd-%s/journal', CEPH_JOURNAL_DISKS[jdx], disk), 'crush_weight', CEPH_DEFAULT_OSD_WEIGHT @@ -112,7 +112,7 @@ prefix '/software/components/ceph/clusters/ceph'; t; }; -'mdss' = MDSS; +'mdss' = CEPH_MDSS; 'monitors' = dict ( 'ceph001', MONITOR1, 'ceph002', MONITOR2, diff --git a/ncm-ceph/src/test/resources/labeled_crushmap.pan b/ncm-ceph/src/test/resources/labeled_crushmap.pan index cd4973eaee..ca1ebf62f2 100644 --- a/ncm-ceph/src/test/resources/labeled_crushmap.pan +++ b/ncm-ceph/src/test/resources/labeled_crushmap.pan @@ -10,7 +10,7 @@ variable CEPH_OSD_DISKS = list('sdc', 'sdd', 'sde', 'sdf', 'sdg', 'sdh', 'sdi', variable CEPH_JOURNAL_DISKS = list('sda4', 'sdb'); variable CEPH_DEFAULT_OSD_WEIGHT = 1.0; -variable MDSS = dict ( +variable CEPH_MDSS = dict ( 'ceph001.cubone.os', dict( 'fqdn', 'ceph001.cubone.os', ), @@ -60,7 +60,7 @@ variable BASE_STEPS = list( ), ); -prefix "/software/components/ceph/clusters/ceph/crushmap/"; +prefix "/software/components/ceph/clusters/ceph/crushmap"; 'types' = list('osd', 'host', 'root'); @@ -104,13 +104,13 @@ prefix "/software/components/ceph/clusters/ceph/crushmap/"; prefix '/software/components/ceph/clusters/ceph'; 'config' = CONFIG; 'osdhosts' = { - t=dict(); - foreach(idx;host;CEPH_HOSTS) { + t = dict(); + foreach(idx; host; CEPH_HOSTS) { d = dict(); - foreach(odx;disk;CEPH_OSD_DISKS) { - jdx= odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks + foreach(odx; disk; CEPH_OSD_DISKS) { + jdx = odx % length(CEPH_JOURNAL_DISKS); ## RR over journal disks if (host == 'ceph003') { - jdx=0; # Empty bucket tst-1 on ceph003 + jdx = 0; # Empty bucket tst-1 on ceph003 }; d[disk] = dict( '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'; t; }; -'mdss' = MDSS; +'mdss' = CEPH_MDSS; 'monitors' = dict ( 'ceph001', MONITOR1, 'ceph002', MONITOR2,