diff --git a/packit.yaml b/.packit.yaml similarity index 100% rename from packit.yaml rename to .packit.yaml diff --git a/utils/coreutils.go b/utils/coreutils.go index 0fc79836b..cd2796198 100644 --- a/utils/coreutils.go +++ b/utils/coreutils.go @@ -761,10 +761,12 @@ func GetCGRVersion() (vers string, err error) { var commitHash string var commitDate time.Time var matched bool - commitDate, err = time.Parse("2006-01-02T15:04:05-07:00", strings.TrimSpace(GitCommitDate)) - if err != nil { - return vers, fmt.Errorf("Building version - error: <%s> compiling commit date", err.Error()) - } + + commitDate, _ = time.Parse("2006-01-02T15:04:05-07:00", strings.TrimSpace(GitCommitDate)) + //ignoring err temporarily until a future fix since we dont get correct date format in older linux distributions + //if err != nil { + //return vers, fmt.Errorf("Building version - error: <%s> compiling commit date", err.Error()) + //} matched, err = regexp.MatchString("^[0-9a-f]{12,}$", GitCommitHash) if err != nil { return vers, fmt.Errorf("Building version - error: <%s> compiling commit hash", err.Error()) diff --git a/utils/coreutils_test.go b/utils/coreutils_test.go index 97a9ed3f8..ee46d5dea 100644 --- a/utils/coreutils_test.go +++ b/utils/coreutils_test.go @@ -1319,13 +1319,13 @@ func TestGetCGRVersion(t *testing.T) { } else if vers != expVers { t.Errorf("Expecting: <%s>, received: <%s>", expVers, vers) } - GitCommitDate = "wrong format" - GitCommitHash = "73014daa0c1d7edcb532d5fe600b8a20d588cdf8" - if vers, err := GetCGRVersion(); err == nil || err.Error() != `Building version - error: compiling commit date` { - t.Error(err) - } else if vers != expVers { - t.Errorf("Expecting: <%s>, received: <%s>", expVers, vers) - } + // GitCommitDate = "wrong format" + // GitCommitHash = "73014daa0c1d7edcb532d5fe600b8a20d588cdf8" + // if vers, err := GetCGRVersion(); err == nil || err.Error() != `Building version - error: compiling commit date` { + // t.Error(err) + // } else if vers != expVers { + // t.Errorf("Expecting: <%s>, received: <%s>", expVers, vers) + // } GitCommitDate = "2016-12-30T19:48:09+01:00" GitCommitHash = "73014DAA0C1D7EDCB532D5FE600B8A20D588CDF8" if vers, err := GetCGRVersion(); err == nil || err.Error() != `Building version - error: compiling commit hash` {