mirror of
https://github.com/pgsty/minio.git
synced 2026-08-12 09:40:28 +03:00
main: Remove all the dead/unused code.
This patch removes some dead and unused code.
This commit is contained in:
+7
-7
@@ -46,7 +46,7 @@ func createBucketsConfigPath() *probe.Error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// getBucketConfigPath - get bucket path.
|
||||
// getBucketConfigPath - get bucket config path.
|
||||
func getBucketConfigPath(bucket string) (string, *probe.Error) {
|
||||
bucketsConfigPath, err := getBucketsConfigPath()
|
||||
if err != nil {
|
||||
@@ -55,7 +55,7 @@ func getBucketConfigPath(bucket string) (string, *probe.Error) {
|
||||
return filepath.Join(bucketsConfigPath, bucket), nil
|
||||
}
|
||||
|
||||
// createBucketConfigPath - create bucket directory.
|
||||
// createBucketConfigPath - create bucket config directory.
|
||||
func createBucketConfigPath(bucket string) *probe.Error {
|
||||
bucketConfigPath, err := getBucketConfigPath(bucket)
|
||||
if err != nil {
|
||||
@@ -125,6 +125,11 @@ func writeBucketPolicy(bucket string, accessPolicyBytes []byte) *probe.Error {
|
||||
return probe.NewError(fs.BucketNameInvalid{Bucket: bucket})
|
||||
}
|
||||
|
||||
// Create bucket config path.
|
||||
if err := createBucketConfigPath(bucket); err != nil {
|
||||
return err.Trace()
|
||||
}
|
||||
|
||||
bucketConfigPath, err := getBucketConfigPath(bucket)
|
||||
if err != nil {
|
||||
return err.Trace()
|
||||
@@ -138,11 +143,6 @@ func writeBucketPolicy(bucket string, accessPolicyBytes []byte) *probe.Error {
|
||||
}
|
||||
}
|
||||
|
||||
// Create top level directory.
|
||||
if e := os.MkdirAll(filepath.Dir(bucketPolicyFile), 0700); e != nil {
|
||||
return probe.NewError(e)
|
||||
}
|
||||
|
||||
// Write bucket policy.
|
||||
if e := ioutil.WriteFile(bucketPolicyFile, accessPolicyBytes, 0600); e != nil {
|
||||
return probe.NewError(e)
|
||||
|
||||
Reference in New Issue
Block a user