@@ -38,44 +38,44 @@ func NewCentOS(exec cmdexec.Executor) *CentOS {
3838func (c * CentOS ) Check () []platform.Check {
3939 var checks []platform.Check
4040
41- result , err := c .removePyCli ()
41+ result , err := c .RemovePyCli ()
4242 checks = append (checks , platform.Check {"Removal of existing CLI" , false , result , err , util .PyCliErr })
4343
4444 result , err = c .CheckExistingInstallation ()
4545 checks = append (checks , platform.Check {"Existing Platform9 Packages Check" , false , result , err , util .ExisitngInstallationErr })
4646
47- result , err = c .checkOSPackages ()
47+ result , err = c .CheckOSPackages ()
4848 checks = append (checks , platform.Check {"Required OS Packages Check" , true , result , err , fmt .Sprintf ("%s. %s" , util .OSPackagesErr , err )})
4949
50- result , err = c .checkSudo ()
50+ result , err = c .CheckSudo ()
5151 checks = append (checks , platform.Check {"SudoCheck" , true , result , err , util .SudoErr })
5252
53- result , err = c .checkEnabledRepos ()
53+ result , err = c .CheckEnabledRepos ()
5454 checks = append (checks , platform.Check {"Required Enabled Repositories Check" , true , result , err , fmt .Sprintf ("%s" , err )})
5555
56- result , err = c .checkCPU ()
56+ result , err = c .CheckCPU ()
5757 checks = append (checks , platform.Check {"CPUCheck" , false , result , err , fmt .Sprintf ("%s %s" , util .CPUErr , err )})
5858
59- result , err = c .checkDisk ()
59+ result , err = c .CheckDisk ()
6060 checks = append (checks , platform.Check {"DiskCheck" , false , result , err , fmt .Sprintf ("%s %s" , util .DiskErr , err )})
6161
62- result , err = c .checkMem ()
62+ result , err = c .CheckMem ()
6363 checks = append (checks , platform.Check {"MemoryCheck" , false , result , err , fmt .Sprintf ("%s %s" , util .MemErr , err )})
6464
65- result , err = c .checkPort ()
65+ result , err = c .CheckPort ()
6666 checks = append (checks , platform.Check {"PortCheck" , false , result , err , fmt .Sprintf ("%s" , err )})
6767
6868 result , err = c .CheckKubernetesCluster ()
6969 checks = append (checks , platform.Check {"Existing Kubernetes Cluster Check" , false , result , err , fmt .Sprintf ("%s" , err )})
7070
71- result , err = c .checkPIDofSystemd ()
71+ result , err = c .CheckPIDofSystemd ()
7272 checks = append (checks , platform.Check {"Check if system is booted with systemd" , true , result , err , fmt .Sprintf ("%s" , err )})
7373
74- result , err = c .checkFirewalldIsRunning ()
74+ result , err = c .CheckFirewalldIsRunning ()
7575 checks = append (checks , platform.Check {"Check if firewalld service is not running" , false , result , err , fmt .Sprintf ("%s" , err )})
7676
7777 if ! util .SwapOffDisabled {
78- result , err = c .disableSwap ()
78+ result , err = c .DisableSwap ()
7979 checks = append (checks , platform.Check {"Disabling swap and removing swap in fstab" , true , result , err , fmt .Sprintf ("%s" , err )})
8080 }
8181
@@ -129,7 +129,7 @@ func (c *CentOS) CheckExistingInstallation() (bool, error) {
129129 return true , nil
130130}
131131
132- func (c * CentOS ) checkOSPackages () (bool , error ) {
132+ func (c * CentOS ) CheckOSPackages () (bool , error ) {
133133
134134 var rhel8 , rocky9 bool
135135 errLines := []string {packageInstallError }
@@ -177,7 +177,7 @@ func (c *CentOS) checkOSPackages() (bool, error) {
177177 return true , nil
178178}
179179
180- func (c * CentOS ) checkEnabledRepos () (bool , error ) {
180+ func (c * CentOS ) CheckEnabledRepos () (bool , error ) {
181181
182182 var centos , rhel8 bool
183183 centos , _ = regexp .MatchString (`.*7\.[3-9]\.*` , string (version ))
@@ -227,7 +227,7 @@ func (c *CentOS) checkEnabledRepos() (bool, error) {
227227 return true , nil
228228}
229229
230- func (c * CentOS ) checkSudo () (bool , error ) {
230+ func (c * CentOS ) CheckSudo () (bool , error ) {
231231 idS , err := c .exec .RunWithStdout ("bash" , "-c" , "id -u | tr -d '\\ n'" )
232232 if err != nil {
233233 return false , err
@@ -241,7 +241,7 @@ func (c *CentOS) checkSudo() (bool, error) {
241241 return id == 0 , nil
242242}
243243
244- func (c * CentOS ) checkCPU () (bool , error ) {
244+ func (c * CentOS ) CheckCPU () (bool , error ) {
245245 cpuS , err := c .exec .RunWithStdout ("bash" , "-c" , "grep -c ^processor /proc/cpuinfo | tr -d '\\ n'" )
246246 if err != nil {
247247 return false , err
@@ -260,7 +260,7 @@ func (c *CentOS) checkCPU() (bool, error) {
260260 return false , fmt .Errorf ("Number of CPUs found: %d" , cpu )
261261}
262262
263- func (c * CentOS ) checkMem () (bool , error ) {
263+ func (c * CentOS ) CheckMem () (bool , error ) {
264264 memS , err := c .exec .RunWithStdout ("bash" , "-c" , "echo $(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE) / (1024 * 1024))) | tr -d '\\ n'" )
265265 if err != nil {
266266 return false , err
@@ -279,7 +279,7 @@ func (c *CentOS) checkMem() (bool, error) {
279279 return false , fmt .Errorf ("Total memory found: %.0f GB" , math .Ceil (mem / 1024 ))
280280}
281281
282- func (c * CentOS ) checkDisk () (bool , error ) {
282+ func (c * CentOS ) CheckDisk () (bool , error ) {
283283 diskS , err := c .exec .RunWithStdout ("bash" , "-c" , "df -k / --output=size | sed 1d | xargs | tr -d '\\ n'" )
284284 if err != nil {
285285 return false , err
@@ -314,7 +314,7 @@ func (c *CentOS) checkDisk() (bool, error) {
314314 return false , fmt .Errorf ("Available disk space: %.0f GB" , math .Trunc (avail / util .GB ))
315315}
316316
317- func (c * CentOS ) checkPort () (bool , error ) {
317+ func (c * CentOS ) CheckPort () (bool , error ) {
318318 var arg string
319319
320320 // For remote execution the command is wrapped under quotes ("") which creates
@@ -345,7 +345,7 @@ func (c *CentOS) checkPort() (bool, error) {
345345 return true , nil
346346}
347347
348- func (c * CentOS ) removePyCli () (bool , error ) {
348+ func (c * CentOS ) RemovePyCli () (bool , error ) {
349349
350350 if _ , err := c .exec .RunWithStdout ("rm" , "-rf" , util .PyCliPath ); err != nil {
351351 return false , err
@@ -422,7 +422,7 @@ func (c *CentOS) installOSPackages(p string) error {
422422 return nil
423423}
424424
425- func (c * CentOS ) disableSwap () (bool , error ) {
425+ func (c * CentOS ) DisableSwap () (bool , error ) {
426426 err := swapoff .SetupNode (c .exec )
427427 if err != nil {
428428 return false , errors .New ("error occurred while disabling swap" )
@@ -431,7 +431,7 @@ func (c *CentOS) disableSwap() (bool, error) {
431431 }
432432}
433433
434- func (c * CentOS ) checkPIDofSystemd () (bool , error ) {
434+ func (c * CentOS ) CheckPIDofSystemd () (bool , error ) {
435435 _ , err := c .exec .RunWithStdout ("bash" , "-c" , "ps -p 1 -o comm= | grep systemd" )
436436 if err != nil {
437437 return false , errors .New ("System is not booted with systemd" )
@@ -440,7 +440,7 @@ func (c *CentOS) checkPIDofSystemd() (bool, error) {
440440 }
441441}
442442
443- func (c * CentOS ) checkFirewalldIsRunning () (bool , error ) {
443+ func (c * CentOS ) CheckFirewalldIsRunning () (bool , error ) {
444444 _ , err := c .exec .RunWithStdout ("bash" , "-c" , "systemctl is-active firewalld" )
445445 if err != nil {
446446 return true , nil
0 commit comments