Skip to content

Commit

Permalink
More delta debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Emma Turetsky committed Feb 24, 2025
1 parent a4998f2 commit 486ce0d
Showing 1 changed file with 66 additions and 66 deletions.
132 changes: 66 additions & 66 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1321,75 +1321,75 @@ func InitServer(ctx context.Context, currentServers server_structs.ServerType) e
}
}

/*
user, err := GetPelicanUser()
if err != nil {
return errors.Wrap(err, "no OS user found for pelican")
}
if err := MkdirAll(param.Monitoring_DataLocation.GetString(), 0750, user.Uid, user.Gid); err != nil {
return errors.Wrapf(err, "failure when creating a directory for the monitoring data")
}
user, err := GetPelicanUser()
if err != nil {
return errors.Wrap(err, "no OS user found for pelican")
}
if err := MkdirAll(param.Monitoring_DataLocation.GetString(), 0750, user.Uid, user.Gid); err != nil {
return errors.Wrapf(err, "failure when creating a directory for the monitoring data")
}

if err := MkdirAll(param.Shoveler_QueueDirectory.GetString(), 0750, user.Uid, user.Gid); err != nil {
return errors.Wrapf(err, "failure when creating a directory for the shoveler on-disk queue")
}
if currentServers.IsEnabled(server_structs.OriginType) {
ost := param.Origin_StorageType.GetString()
switch ost {
case "https":
httpSvcUrl := param.Origin_HttpServiceUrl.GetString()
if httpSvcUrl == "" {
return errors.New("Origin.HTTPServiceUrl may not be empty when the origin is configured with an https backend")
}
_, err := url.Parse(httpSvcUrl)
if err != nil {
return errors.Wrap(err, "unable to parse Origin.HTTPServiceUrl as a URL")
}
case "globus":
pvd, err := GetOIDCProdiver()
if err != nil || pvd != Globus {
log.Info("Server OIDC provider is not Globus. Use Origin.GlobusClientIDFile instead")
} else {
// OIDC provider is globus
break
}
// Check if ClientID and ClientSecret are valid
clientIDPath := param.Origin_GlobusClientIDFile.GetString()
clientSecretPath := param.Origin_GlobusClientSecretFile.GetString()
if clientIDPath == "" {
return errors.New("Origin.GlobusClientIDFile may not be empty with Globus storage backend ")
}
_, err = os.Stat(clientIDPath)
if err != nil {
return errors.Wrap(err, "Origin.GlobusClientIDFile is not a valid filepath")
}
if clientSecretPath == "" {
return errors.New("Origin.GlobusClientSecretFile may not be empty with Globus storage backend ")
}
_, err = os.Stat(clientSecretPath)
if err != nil {
return errors.Wrap(err, "Origin.GlobusClientSecretFile is not a valid filepath")
}
case "xroot":
xrootSvcUrl := param.Origin_XRootServiceUrl.GetString()
if xrootSvcUrl == "" {
return errors.New("Origin.XRootServiceUrl may not be empty when the origin is configured with an xroot backend")
}
_, err := url.Parse(xrootSvcUrl)
if err != nil {
return errors.Wrap(err, "unable to parse Origin.XrootServiceUrl as a URL")
}
case "s3":
s3SvcUrl := param.Origin_S3ServiceUrl.GetString()
if s3SvcUrl == "" {
return errors.New("Origin.S3ServiceUrl may not be empty when the origin is configured with an s3 backend")
}
_, err := url.Parse(s3SvcUrl)
if err != nil {
return errors.Wrap(err, "unable to parse Origin.S3ServiceUrl as a URL")
}
if err := MkdirAll(param.Shoveler_QueueDirectory.GetString(), 0750, user.Uid, user.Gid); err != nil {
return errors.Wrapf(err, "failure when creating a directory for the shoveler on-disk queue")
}
if currentServers.IsEnabled(server_structs.OriginType) {
ost := param.Origin_StorageType.GetString()
switch ost {
case "https":
httpSvcUrl := param.Origin_HttpServiceUrl.GetString()
if httpSvcUrl == "" {
return errors.New("Origin.HTTPServiceUrl may not be empty when the origin is configured with an https backend")
}
_, err := url.Parse(httpSvcUrl)
if err != nil {
return errors.Wrap(err, "unable to parse Origin.HTTPServiceUrl as a URL")
}
case "globus":
pvd, err := GetOIDCProdiver()
if err != nil || pvd != Globus {
log.Info("Server OIDC provider is not Globus. Use Origin.GlobusClientIDFile instead")
} else {
// OIDC provider is globus
break
}
// Check if ClientID and ClientSecret are valid
clientIDPath := param.Origin_GlobusClientIDFile.GetString()
clientSecretPath := param.Origin_GlobusClientSecretFile.GetString()
if clientIDPath == "" {
return errors.New("Origin.GlobusClientIDFile may not be empty with Globus storage backend ")
}
_, err = os.Stat(clientIDPath)
if err != nil {
return errors.Wrap(err, "Origin.GlobusClientIDFile is not a valid filepath")
}
if clientSecretPath == "" {
return errors.New("Origin.GlobusClientSecretFile may not be empty with Globus storage backend ")
}
_, err = os.Stat(clientSecretPath)
if err != nil {
return errors.Wrap(err, "Origin.GlobusClientSecretFile is not a valid filepath")
}
case "xroot":
xrootSvcUrl := param.Origin_XRootServiceUrl.GetString()
if xrootSvcUrl == "" {
return errors.New("Origin.XRootServiceUrl may not be empty when the origin is configured with an xroot backend")
}
_, err := url.Parse(xrootSvcUrl)
if err != nil {
return errors.Wrap(err, "unable to parse Origin.XrootServiceUrl as a URL")
}
case "s3":
s3SvcUrl := param.Origin_S3ServiceUrl.GetString()
if s3SvcUrl == "" {
return errors.New("Origin.S3ServiceUrl may not be empty when the origin is configured with an s3 backend")
}
_, err := url.Parse(s3SvcUrl)
if err != nil {
return errors.Wrap(err, "unable to parse Origin.S3ServiceUrl as a URL")
}
}
}
/*
if currentServers.IsEnabled(server_structs.CacheType) && !param.Cache_Port.IsSet() && !param.Xrootd_Port.IsSet() {
return errors.New("the configuration Cache.Port is not set but the Cache module is enabled. Please set Cache.Port")
Expand Down

0 comments on commit 486ce0d

Please sign in to comment.