mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-21 11:56:38 +00:00
Merge pull request #456 from rustfs/fix/spelling-errors
fix: correct spelling errors in codebase
This commit is contained in:
@@ -512,7 +512,7 @@ impl ShardReader {
|
|||||||
warn!("ec decode read ress {:?}", &ress);
|
warn!("ec decode read ress {:?}", &ress);
|
||||||
warn!("ec decode read errors {:?}", &errors);
|
warn!("ec decode read errors {:?}", &errors);
|
||||||
|
|
||||||
return Err(Error::other("shard reader read faild"));
|
return Err(Error::other("shard reader read failed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
self.offset += self.shard_size;
|
self.offset += self.shard_size;
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ impl ECStore {
|
|||||||
sleep(Duration::from_secs(wait_sec)).await;
|
sleep(Duration::from_secs(wait_sec)).await;
|
||||||
|
|
||||||
if exit_count > 10 {
|
if exit_count > 10 {
|
||||||
return Err(Error::other("ec init faild"));
|
return Err(Error::other("ec init failed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
exit_count += 1;
|
exit_count += 1;
|
||||||
|
|||||||
@@ -114,13 +114,13 @@ pub fn find_ellipses_patterns(arg: &str) -> Result<ArgPattern> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut pattens = Vec::new();
|
let mut patterns = Vec::new();
|
||||||
while let Some(prefix) = parts.get(1) {
|
while let Some(prefix) = parts.get(1) {
|
||||||
let seq = parse_ellipses_range(parts[2].into())?;
|
let seq = parse_ellipses_range(parts[2].into())?;
|
||||||
|
|
||||||
match ELLIPSES_RE.captures(prefix.into()) {
|
match ELLIPSES_RE.captures(prefix.into()) {
|
||||||
Some(cs) => {
|
Some(cs) => {
|
||||||
pattens.push(Pattern {
|
patterns.push(Pattern {
|
||||||
seq,
|
seq,
|
||||||
prefix: String::new(),
|
prefix: String::new(),
|
||||||
suffix: parts[3].into(),
|
suffix: parts[3].into(),
|
||||||
@@ -128,7 +128,7 @@ pub fn find_ellipses_patterns(arg: &str) -> Result<ArgPattern> {
|
|||||||
parts = cs;
|
parts = cs;
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
pattens.push(Pattern {
|
patterns.push(Pattern {
|
||||||
seq,
|
seq,
|
||||||
prefix: prefix.as_str().to_owned(),
|
prefix: prefix.as_str().to_owned(),
|
||||||
suffix: parts[3].into(),
|
suffix: parts[3].into(),
|
||||||
@@ -141,7 +141,7 @@ pub fn find_ellipses_patterns(arg: &str) -> Result<ArgPattern> {
|
|||||||
// Check if any of the prefix or suffixes now have flower braces
|
// Check if any of the prefix or suffixes now have flower braces
|
||||||
// left over, in such a case we generally think that there is
|
// left over, in such a case we generally think that there is
|
||||||
// perhaps a typo in users input and error out accordingly.
|
// perhaps a typo in users input and error out accordingly.
|
||||||
for p in pattens.iter() {
|
for p in patterns.iter() {
|
||||||
if p.prefix.contains(OPEN_BRACES)
|
if p.prefix.contains(OPEN_BRACES)
|
||||||
|| p.prefix.contains(CLOSE_BRACES)
|
|| p.prefix.contains(CLOSE_BRACES)
|
||||||
|| p.suffix.contains(OPEN_BRACES)
|
|| p.suffix.contains(OPEN_BRACES)
|
||||||
@@ -154,7 +154,7 @@ pub fn find_ellipses_patterns(arg: &str) -> Result<ArgPattern> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(ArgPattern::new(pattens))
|
Ok(ArgPattern::new(patterns))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// returns true if input arg has ellipses type pattern.
|
/// returns true if input arg has ellipses type pattern.
|
||||||
@@ -173,7 +173,7 @@ pub fn parse_ellipses_range(pattern: &str) -> Result<Vec<String>> {
|
|||||||
if !pattern.contains(OPEN_BRACES) {
|
if !pattern.contains(OPEN_BRACES) {
|
||||||
return Err(Error::other("Invalid argument"));
|
return Err(Error::other("Invalid argument"));
|
||||||
}
|
}
|
||||||
if !pattern.contains(OPEN_BRACES) {
|
if !pattern.contains(CLOSE_BRACES) {
|
||||||
return Err(Error::other("Invalid argument"));
|
return Err(Error::other("Invalid argument"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1508,14 +1508,14 @@ impl S3 for FS {
|
|||||||
// warn!("input policy {}", &policy);
|
// warn!("input policy {}", &policy);
|
||||||
|
|
||||||
let cfg: BucketPolicy =
|
let cfg: BucketPolicy =
|
||||||
serde_json::from_str(&policy).map_err(|e| s3_error!(InvalidArgument, "parse policy faild {:?}", e))?;
|
serde_json::from_str(&policy).map_err(|e| s3_error!(InvalidArgument, "parse policy failed {:?}", e))?;
|
||||||
|
|
||||||
if let Err(err) = cfg.is_valid() {
|
if let Err(err) = cfg.is_valid() {
|
||||||
warn!("put_bucket_policy err input {:?}, {:?}", &policy, err);
|
warn!("put_bucket_policy err input {:?}, {:?}", &policy, err);
|
||||||
return Err(s3_error!(InvalidPolicyDocument));
|
return Err(s3_error!(InvalidPolicyDocument));
|
||||||
}
|
}
|
||||||
|
|
||||||
let data = serde_json::to_vec(&cfg).map_err(|e| s3_error!(InternalError, "parse policy faild {:?}", e))?;
|
let data = serde_json::to_vec(&cfg).map_err(|e| s3_error!(InternalError, "parse policy failed {:?}", e))?;
|
||||||
|
|
||||||
metadata_sys::update(&bucket, BUCKET_POLICY_CONFIG, data)
|
metadata_sys::update(&bucket, BUCKET_POLICY_CONFIG, data)
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user