Merge "Add default limit for container/object"
This commit is contained in:
commit
f19240fc29
openstackclient/object/v1
@ -15,11 +15,18 @@
|
|||||||
|
|
||||||
"""Container v1 action implementations"""
|
"""Container v1 action implementations"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class CreateContainer(command.Lister):
|
class CreateContainer(command.Lister):
|
||||||
"""Create new container"""
|
"""Create new container"""
|
||||||
@ -38,6 +45,10 @@ class CreateContainer(command.Lister):
|
|||||||
|
|
||||||
results = []
|
results = []
|
||||||
for container in parsed_args.containers:
|
for container in parsed_args.containers:
|
||||||
|
if len(container) > 256:
|
||||||
|
LOG.warning(
|
||||||
|
_('Container name is %s characters long, the default limit'
|
||||||
|
' is 256'), len(container))
|
||||||
data = self.app.client_manager.object_store.container_create(
|
data = self.app.client_manager.object_store.container_create(
|
||||||
container=container,
|
container=container,
|
||||||
)
|
)
|
||||||
|
@ -15,12 +15,18 @@
|
|||||||
|
|
||||||
"""Object v1 action implementations"""
|
"""Object v1 action implementations"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
from osc_lib.cli import parseractions
|
from osc_lib.cli import parseractions
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
from osc_lib import utils
|
from osc_lib import utils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from openstackclient.i18n import _
|
||||||
|
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class CreateObject(command.Lister):
|
class CreateObject(command.Lister):
|
||||||
"""Upload object to container"""
|
"""Upload object to container"""
|
||||||
@ -44,6 +50,10 @@ class CreateObject(command.Lister):
|
|||||||
|
|
||||||
results = []
|
results = []
|
||||||
for obj in parsed_args.objects:
|
for obj in parsed_args.objects:
|
||||||
|
if len(obj) > 1024:
|
||||||
|
LOG.warning(
|
||||||
|
_('Object name is %s characters long, default limit'
|
||||||
|
' is 1024'), len(obj))
|
||||||
data = self.app.client_manager.object_store.object_create(
|
data = self.app.client_manager.object_store.object_create(
|
||||||
container=parsed_args.container,
|
container=parsed_args.container,
|
||||||
object=obj,
|
object=obj,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user