CURRENT PATH:
/
opt
/
gsutil
/
gslib
/
commands
/
__pycache__
/
[ ⬅ KEMBALI ]
|
[ HOME ]
Upload File:
Upload Ke Sini
Dir Baru
File Baru
Editing:
rb.cpython-39.pyc
a +(Wg� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddl mZ dd lm Z dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ dZde d ZG dd� de �ZdS )z@Implementation of rb command for deleting cloud storage buckets.� )�absolute_import)�print_function)�division)�unicode_literals)�NotEmptyException)�Command)�CommandArgument)�ApiSelector)�CommandException)�NO_URLS_MATCHED_TARGET)�StorageUrlFromString)�NO_MAX)�GcloudStorageFlag)�GcloudStorageMapz( gsutil rb [-f] gs://<bucket_name>... z <B>SYNOPSIS</B> a� <B>DESCRIPTION</B> Delete one or more buckets. Buckets must be empty before you can delete them. Be certain you want to delete a bucket before you do so, as once it is deleted the name becomes available and another user may create a bucket with that name. (But see also "DOMAIN NAMED BUCKETS" under "gsutil help naming" for help carving out parts of the bucket name space.) <B>OPTIONS</B> -f Continues silently (without printing error messages) despite errors when removing buckets. If some buckets couldn't be removed, gsutil's exit status will be non-zero even if this flag is set. If no buckets could be removed, the command raises a "no matches" error. c @ s� e Zd ZdZejdg d�ededdddej ej gej e�� gd�Z ejdg d�d d ei d�Zeg d�d ed�id�Zdd� ZdS )� RbCommandz$Implementation of gsutil rb command.�rb)ZdeletebucketZremovebucketZ removebuckets�rmdir� �fFr )�command_name_aliases�usage_synopsis�min_args�max_args�supported_sub_args�file_url_ok�provider_url_ok�urls_start_arg�gs_api_support�gs_default_api�argparse_arguments�command_helpzRemove buckets)� help_name�help_name_aliases� help_type�help_one_line_summary� help_text�subcommand_help_text)�storage�buckets�delete�-fz--continue-on-error)�gcloud_command�flag_mapc C sh d| _ | jr*| jD ]\}}|dkrd| _ qd}d}| jD �]}t|�}|�� rVtd��zt| �|�jdgd��}W n d}| j r�Y q8n� Y n0 |D ]�}|j } | j �d| � z| jj | j| jd� W nr t�y } z@d}| j r�W Y d } ~ q�nd | jv �r td| ��n� W Y d } ~ n"d } ~ 0 d}| j �s4� Y n0 d}q�q8|�sZttt| j� ��|�rddS d S )z'Command entry point for the rb command.Fr* Tz."rb" command requires a provider or bucket URL�id)� bucket_fieldszRemoving %s...)�providerN�VersionedBucketNotEmptyzqBucket is not empty. Note: this is a versioned bucket, so to delete all objects you need to use: gsutil rm -r %sr r )�continue_on_error�sub_opts�argsr �IsObjectr �list�WildcardIterator�IterBuckets�storage_url�logger�info� gsutil_api�DeleteBucket�bucket_name�schemer �reasonr )�self�o�unused_a� did_some_workZsome_failed�url_str�wildcard_urlZblrs�blr�url�e� rI � /opt/gsutil/gslib/commands/rb.py� RunCommandn sT ��zRbCommand.RunCommandN)�__name__� __module__�__qualname__�__doc__r �CreateCommandSpec� _SYNOPSISr r �XML�JSONr �%MakeZeroOrMoreCloudBucketURLsArgument�command_spec�HelpSpec�_DETAILED_HELP_TEXT� help_specr r �gcloud_storage_maprK rI rI rI rJ r <