Use a const for the default container name (#139)
This commit is contained in:
Родитель
72560f9a96
Коммит
c7a2ae5001
|
@ -120,12 +120,13 @@ namespace WWT.Azure
|
|||
{
|
||||
return info.container;
|
||||
}
|
||||
return $"{_options.Container}";
|
||||
|
||||
return _options.Container;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Azure Blob storage uses a virtual "folder" structure - the blob name having /'s indicates folders
|
||||
/// Ex: plate-data/testname/0/test.png
|
||||
/// Ex: coredata/testname/0/test.png
|
||||
/// container blobName, but will show as folder testname, subfolder 0 with test.png in it
|
||||
/// </summary>
|
||||
private string GetBlobName(string plateName, int level, int x, int y)
|
||||
|
|
|
@ -2,9 +2,11 @@ namespace WWT.Azure
|
|||
{
|
||||
public class AzurePlateTilePyramidOptions
|
||||
{
|
||||
public const string DefaultContainer = "coredata";
|
||||
|
||||
public bool CreateContainer { get; set; }
|
||||
|
||||
public string Container { get; set; } = "plate-data";
|
||||
public string Container { get; set; } = DefaultContainer;
|
||||
|
||||
public bool SkipIfExists { get; set; }
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ using NSubstitute;
|
|||
using NSubstitute.Extensions;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Castle.Core.Smtp;
|
||||
using Xunit;
|
||||
|
||||
namespace WWT.Azure.Tests
|
||||
|
@ -117,7 +116,6 @@ namespace WWT.Azure.Tests
|
|||
var options = new AzurePlateTilePyramidOptions
|
||||
{
|
||||
SkipIfExists = skipIfExists,
|
||||
Container = "plate-data"
|
||||
};
|
||||
|
||||
using var mock = ConfigureServiceClient(plateFile, level, x, y)
|
||||
|
@ -139,7 +137,7 @@ namespace WWT.Azure.Tests
|
|||
{
|
||||
// For all the non dss plate files
|
||||
var blobName = $"{plateFile.Replace(".plate", string.Empty)}/L{level}X{x}Y{y}.png";
|
||||
var containerName = "plate-data";
|
||||
var containerName = AzurePlateTilePyramidOptions.DefaultContainer;
|
||||
|
||||
if (plateFile == "dssterrapixel.plate")
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace PlateManager
|
|||
new Option<IEnumerable<FileInfo>>(new[] { "--file", "-f" }) { IsRequired = true }.ExistingOnly(),
|
||||
new Option<string>("--storage", () => "https://127.0.0.1:10000/devstoreaccount1/"),
|
||||
new Option<bool>("--useplate2format"),
|
||||
new Option<string>("--container", () => "coredata"),
|
||||
new Option<string>("--container", () => AzurePlateTilePyramidOptions.DefaultContainer),
|
||||
new Option<bool>("--interactive"),
|
||||
new Option<bool>("--skip-existing", () => true),
|
||||
new Option<LogLevel>("--log-level", () => LogLevel.Information),
|
||||
|
|
Загрузка…
Ссылка в новой задаче