twc-cli 1.3.0__tar.gz → 1.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of twc-cli might be problematic. Click here for more details.

@@ -2,11 +2,21 @@
2
2
 
3
3
  В этом файле описаны все значимые изменения в Timeweb Cloud CLI. В выпусках мы придерживается правил [семантического версионирования](https://semver.org/lang/ru/).
4
4
 
5
+ # Версия 1.3.1 (2023.04.13)
6
+
7
+ Изменено:
8
+
9
+ - В команде `twc s3 mb` опция `--preset-id` теперь необязательная. Будет выбран минимальный пресет.
10
+
11
+ Исправлено:
12
+
13
+ - Исправлена ошибка при попытке создать дополнительный профиль через `twc config`.
14
+
5
15
  # Версия 1.3.0 (2023.04.13)
6
16
 
7
17
  Добавлено:
8
18
 
9
- - Добавлена команда `twc storage` (алиас `twc s3`) для управления бакетами в объектном хранилище Timeweb Cloud. Доступны базовые операции с бакетами. Также реализованы субкоманды для работы с доменами и пользователями хранилища. Обратите внимание, что в twc не планируется добавлять реализацию S3-клиента, пользуйтесь любым совместимым клиентом, например, [s3cmd](https://s3tools.org/s3cmd) или [rclone](https://rclone.org/), команда `twc s3 genconfig` позволит сгенерировать конфигурационный файл для этих утилит (см. документацию).
19
+ - Добавлена команда `twc storage` (алиас `twc s3`) для управления бакетами в объектном хранилище Timeweb Cloud. Доступны базовые операции с бакетами. Также реализованы субкоманды для работы с доменами и пользователями хранилища. Обратите внимание, что в twc не планируется добавлять реализацию S3-клиента, пользуйтесь любым совместимым клиентом, например, [s3cmd](https://s3tools.org/s3cmd) или [rclone](https://rclone.org/), команда `twc s3 genconfig` позволит сгенерировать конфигурационный файл для этих утилит (см. [документацию](docs/ru/README.md#получение-конфигурации-для-s3-клиентов)).
10
20
  - Добавлены субкоманды для `twc config`. Теперь можно: сделать дамп настроек CLI (`twc config dump`), изменять настройки без ручного редактирования файла (`twc config set`), получить путь до файла (`twc config file`), открыть файл в редакторе по умолчанию (`twc config edit`).
11
21
 
12
22
  Изменено:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: twc-cli
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Timeweb Cloud Command Line Interface.
5
5
  Home-page: https://github.com/timeweb-cloud/twc
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "twc-cli"
3
- version = "1.3.0"
3
+ version = "1.3.1"
4
4
  description = "Timeweb Cloud Command Line Interface."
5
5
  authors = ["ge <dev@timeweb.cloud>"]
6
6
  homepage = "https://github.com/timeweb-cloud/twc"
@@ -9,5 +9,5 @@
9
9
  import sys
10
10
 
11
11
 
12
- __version__ = "1.3.0"
12
+ __version__ = "1.3.1"
13
13
  __pyversion__ = sys.version.replace("\n", "")
@@ -46,10 +46,19 @@ def make_config(filepath: str = get_default_config_file()):
46
46
  current_config = load_config()
47
47
  profile = click.prompt("Enter profile name", default="default")
48
48
  token = click.prompt(f"Enter API token for '{profile}'")
49
- current_config[profile] = utils.merge_dicts(
50
- current_config[profile],
51
- {"token": token},
52
- )
49
+ try:
50
+ # Edit existing profile
51
+ current_config[profile] = utils.merge_dicts(
52
+ current_config[profile],
53
+ {"token": token},
54
+ )
55
+ except KeyError:
56
+ # Add new profile
57
+ current_config[profile] = {} # init new config section
58
+ current_config[profile] = utils.merge_dicts(
59
+ current_config[profile],
60
+ {"token": token},
61
+ )
53
62
  write_to_file(current_config, filepath)
54
63
  else:
55
64
  sys.exit("Aborted!")
@@ -226,7 +226,7 @@ def storage_list_presets(
226
226
  @storage.command("mb", help="Make bucket.")
227
227
  @options(GLOBAL_OPTIONS)
228
228
  @options(OUTPUT_FORMAT_OPTION)
229
- @click.option("--preset-id", type=int, required=True, help="Bucket preset ID.")
229
+ @click.option("--preset-id", type=int, help="Bucket preset ID.")
230
230
  @click.option(
231
231
  "--project-id",
232
232
  type=int,
@@ -257,6 +257,11 @@ def storage_mb(
257
257
  # pylint: disable=too-many-locals
258
258
 
259
259
  client = create_client(config, profile)
260
+
261
+ if not preset_id:
262
+ # Select minimal preset
263
+ preset_id = 389 # 10G disk
264
+
260
265
  is_public = False
261
266
  if bucket_type == "public":
262
267
  is_public = True
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes