Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
python3-dmapi / usr / lib / python3 / dist-packages / dmapi / cmd / __pycache__ / manage.cpython-35.pyc
Size: Mime:


çáþ\[ã@s dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
ZddlmZddlZddlmZddlmZdd	lmZddlZddlZddljjjZdd
lm Z!ddl"m#Z#ddl$m%Z&ddl'Z(dd
l(m)Z)ddl(m*Z*ddl(m+Z+ddl,m-Z-ddl.m/Z0ddl(m
Z
ddl1m2Z2ddl(m3Z3ddl4m5Z6ddl4m7Z8ddl4m9Z:ddl4m;Z<ddl4m=Z>ddl4m?Z@ddl4mAZBddl4mCZDddl4mEZEddl(mFZFddl(mGZGddl(mHZHdd l(mIZIdd!lJmKZKe(jLjMZMeFjNZNd"d#d$gZOe&jPZPe&jQZQd%d&„ZRd'd(„ZSd)d*„ZTGd+d,„d,eUƒZVejd-d.„ƒZWGd/d0„d0eUƒZXGd1d2„d2eUƒZYGd3d4„d4eUƒZZGd5d6„d6eUƒZ[Gd7d8„d8eUƒZ\d9eZd:e[d;e\d<eYd=eVd>eXiZ]ej^e&j_d?e]ƒZ_ej`d@dAdBdCdDdEe_ƒZaejbdFdGdHdCdIƒZcdJdK„ZddS)Lz&
  CLI interface for nova management.
é)Úprint_functionN)Úcfg)Ú	exception)Úlog)Úencodeutils)Úimportutils)Ú	uuidutils)Úurl)Úec2utils)Úcommon)Úconfig)Úcontext)Údb)Ú	migration)Úapi)Ú_)Úobjects)Ú	aggregate)Úblock_device)Ú
build_request)Úhost_mapping)Úinstance)Úinstance_group)Úkeypair)Úquotas)Úrequest_spec)Úquota)Úrpc)Úutils)Úversion)Úironiczoslo_concurrency=INFOzoslo_db=INFOzoslo_policy=INFOcCs!d|krtj|ƒS|SdS)zHelper function to convert various volume id types to internal id.
    args: [object_id], e.g. 'vol-0000000a' or 'volume-0000000a' or '10'
    ú-N)r
Zec2_vol_id_to_uuid)Z	object_id©r"ú2/usr/lib/python3/dist-packages/dmapi/cmd/manage.pyÚparam2idHs
r$cCsatj|ƒ}tjdd|jƒ}tj|j||j|j|j|j	ƒ}tj
|ƒS)Nz:.*@z:****@)ÚurlparseÚreÚsubÚnetlocÚParseResultÚschemeÚpathÚparamsÚqueryÚfragmentÚ
urlunparse)r	ÚparsedZsafe_netlocZ
new_parsedr"r"r#Úmask_passwd_in_urlRs	r1cCs+t|ƒttdƒƒtjdƒdS)Nz’The above error may show that the database has not been created.
Please create a database using 'nova-manage db sync' before running this command.é)ÚprintrÚsysÚexit)Zcaught_exceptionr"r"r#Ú	_db_error\s
r6c@sÓeZdZdZdZedd„ƒZeddddd	ƒed
ddddƒed
ddddƒdddd„ƒƒƒZeddddd	ƒdd„ƒZ	edddddƒddd„ƒZ
dS)ÚFloatingIpCommandszClass for managing floating IP.z¦DEPRECATED: Floating IP commands are deprecated since nova-network is deprecated in favor of Neutron. The floating IP commands will be removed in an upcoming release.cCs´ytj|ƒgSWn™tk
r¯tj|ƒ}|jdkrjtdƒ|j}tjd|ƒ‚nA|jdkr¡tdƒ|j}tjd|ƒ‚n
|j	ƒSYnXdS)z¯Iterate over hosts within an address range.

        If an explicit range specifier is missing, the parameter is
        interpreted as a specific individual address.
        éz@/%s should be specified as single address(es) not in cidr formatÚreasoni@Bz]Too many IP addresses will be generated.  Please increase /%s to reduce the number generated.N)
ÚnetaddrZ	IPAddressÚ
ValueErrorZ	IPNetworkÚsizerÚ	prefixlenrZInvalidInputZ
iter_hosts)Ú	addressesÚnetr9r"r"r#Úaddress_to_hostsms
	
	
z#FloatingIpCommands.address_to_hostsz
--ip_rangeÚmetavarz<range>ÚhelpzIP rangez--poolz<pool>z
Optional poolz--interfacez<interface>zOptional interfaceNcsªtjƒ}ˆstj‰ˆs*tj‰‡‡fdd†|j|ƒDƒ}ytj||ddƒWn:tj	k
r¥}zt
d|ƒdSWYdd}~XnXdS)z'Creates floating IPs for zone by range.cs.g|]$}dt|ƒdˆdˆi‘qS)ÚaddressÚpoolÚ	interface)Ústr)Ú.0rC)rErDr"r#ú
<listcomp>’s	z-FloatingIpCommands.create.<locals>.<listcomp>Zwant_resultFz	error: %sr2N)r
Úget_admin_contextÚCONFZdefault_floating_poolZpublic_interfacer@rZfloating_ip_bulk_createrZFloatingIpExistsr3)ÚselfÚip_rangerDrEÚ
admin_contextÚipsÚexcr")rErDr#Úcreate‡s		zFloatingIpCommands.createcCs<tjƒ}dd„|j|ƒDƒ}tj||ƒdS)zDeletes floating IPs by range.css!|]}dt|ƒiVqdS)rCN)rF)rGrCr"r"r#ú	<genexpr>¢sz,FloatingIpCommands.delete.<locals>.<genexpr>N)r
rIr@rZfloating_ip_bulk_destroy)rKrLrMrNr"r"r#Údeletes	zFloatingIpCommands.deletez--hostz<host>ÚHostcCsÞtjƒ}y4|dkr-tj|ƒ}ntj||ƒ}Wn)tjk
rkttdƒƒdSYnXxk|D]c}d}|dr©tj	||dƒ}|d}td|d|d||d|d	fƒqsWdS)
z|Lists all floating IPs (optionally by host).

        Note: if host is given, only active floating IPs are returned
        Nz+No floating IP addresses have been defined.Zfixed_ip_idÚ
instance_uuidz%s	%s	%s	%s	%sÚ
project_idrCrDrE)
r
rIrZfloating_ip_get_allZfloating_ip_get_all_by_hostrZNoFloatingIpsDefinedr3rZfixed_ip_get)rKÚhostÚctxtZfloating_ipsZfloating_iprTZfixed_ipr"r"r#Úlist¦s$	



zFloatingIpCommands.list)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚdescriptionÚstaticmethodr@ÚargsrPrRrXr"r"r"r#r7ds$	r7cOs-tjƒr ttdƒƒdS|||ŽS)z)Decorator to validate the network plugin.zhERROR: Network commands are not supported when using the Neutron API.  Use python-neutronclient instead.é)rZ
is_neutronr3r)Úfr_Úkwargsr"r"r#Úvalidate_network_pluginÂsrcc)@s7eZdZdZdZeedddddƒedd	d
ddddƒed
ddddƒedddddƒedddddƒedd	dddddƒedd	dddƒedd	dddƒeddd ƒed!dd"ƒed#dd$dd%ƒed&dd'dd(ƒed)dd*dd+ƒed,dd-dd.ƒed/dd-dd0ƒed1dd2dd3ƒed4dddd5ƒed6dd7dd8ƒed9dddd:ƒd;d;d;d;d;d;d;d;d;d;d;d;d;d;d;d;d;d;d;d<d=„ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒZed>d?„ƒZeed@ddddAƒed1ddBddCƒd;d;dDdE„ƒƒƒZ	eed@ddddFƒedGddHddIƒedJddKddLƒedMdNdOd	dPdQdRddSƒedTdNdOd	dUdQdRddVƒd;d;d;d;dWdX„ƒƒƒƒƒƒZ
d;S)YÚNetworkCommandszClass for managing networks.zžDEPRECATED: Network commands are deprecated since nova-network is deprecated in favor of Neutron. The network commands will be removed in an upcoming release.z--labelrAz<label>rBzLabel for network (ex: public)z--fixed_range_v4ÚdestÚcidrz<x.x.x.x/yy>zIPv4 subnet (ex: 10.0.0.0/8)z--num_networksz<number>zNumber of networks to createz--network_sizezNumber of IPs per networkz--vlanz	<vlan id>zvlan idz--vlan_startÚ
vlan_startz<vlan start id>z
vlan start idz--vpnÚ	vpn_startz	vpn startz--fixed_range_v6Úcidr_v6zIPv6 subnet (ex: fe80::/64z	--gatewayÚgatewayz--gateway_v6zipv6 gatewayz--bridgez<bridge>z1VIFs on this network are connected to this bridgez--bridge_interfacez<bridge interface>z)the bridge is connected to this interfacez--multi_hostz	<'T'|'F'>z
Multi hostz--dns1z
<DNS Address>z	First DNSz--dns2z
Second DNSz--uuidz<network uuid>zNetwork UUIDz--fixed_cidrz,IPv4 subnet for fixed IPs (ex: 10.20.0.0/16)z--project_idz<project id>z
Project idz
--priorityzNetwork interface priorityNcCs¾|stjddƒ‚t|ƒdkr6tjƒ‚|p?|	sTtjddƒ‚dd„ttƒjƒƒDƒ}|dk	r’|dk|d	<tjt	j
ƒ}|jtj
ƒ|dS)
z$Creates fixed IPs for host by range.ÚreqÚlabeléÿzcidr or cidr_v6cSs1i|]'\}}|r|dkr||“qS)rKr")rGÚkÚvr"r"r#ú
<dictcomp>s		z*NetworkCommands.create.<locals>.<dictcomp>NÚTÚ
multi_host)rZNetworkNotCreatedÚlenZLabelTooLongrXÚlocalsÚitemsrÚ
import_objectrJÚnetwork_managerZcreate_networksr
rI)rKrlrfZnum_networksZnetwork_sizerrÚvlanrgrhrirjZ
gateway_v6ZbridgeZbridge_interfaceÚdns1Údns2rUZpriorityÚuuidZ
fixed_cidrrbÚnet_managerr"r"r#rPÔs("zNetworkCommands.createcCsÿd}t|tdƒtdƒtdƒtdƒtdƒtdƒtdƒtd	ƒtd
ƒf	ƒytjtjƒƒ}Wn%tjk
r¥ttdƒƒYnVXxR|D]J}t||j|j	|j
|j|j|j
|j|j|jf	ƒq­WdS)
zList all created networks.z4%-5s	%-18s	%-15s	%-15s	%-15s	%-15s	%-15s	%-15s	%-15sÚidZIPv4ZIPv6z
start addressZDNS1ZDNS2ZVlanIDÚprojectr{zNo networks foundN)r3rrZnetwork_get_allr
rIrZNoNetworksFoundr}rfriZ
dhcp_startryrzrxrUr{)rKÚ_fmtZnetworksÚnetworkr"r"r#rX
s0							
zNetworkCommands.listz
--fixed_rangezNetwork to deletez<uuid>zUUID of network to deletecCsž|dkr*|dkr*ttdƒƒ‚tjtjƒ}dtjkr|dkrittdƒƒ‚|rttdƒƒ‚|jtjƒ||ƒdS)zDeletes a network.Nz)Please specify either fixed_range or uuidZNeutronManagerz+UUID is required to delete Neutron Networksz@Deleting by fixed_range is not supported with the NeutronManager)	Ú	ExceptionrrrvrJrwZdelete_networkr
rI)rKÚfixed_ranger{r|r"r"r#rR*szNetworkCommands.deletezNetwork to modifyz	--projectz<project name>zProject name to associatez--hostz<host>zHost to associatez--disassociate-projectÚactionÚ
store_trueÚdis_projectÚdefaultFz!Disassociate Network from Projectz--disassociate-hostÚdis_hostzDisassociate Host from Projectc
CsÆtjƒ}tj||ƒ}i}|r4d|d<|rDd|d<|sP|r‹|s\|rpd}	t|	ƒdStj||d|ƒdS|r›||d<|r«||d<tj||d|ƒdS)z“Associate/Disassociate Network with Project and/or Host
        arguments: network project host
        leave any field blank to ignore it
        NrUrVzCERROR: Unexpected arguments provided. Please use separate commands.r2r})r
rIrZnetwork_get_by_cidrr3Znetwork_update)
rKr‚r~rVr…r‡rMr€r?Z	error_msgr"r"r#Úmodify>s&




zNetworkCommands.modify)rYrZr[r\r]rcr_rPrXrRrˆr"r"r"r#rdÌsl			N rdc
@s˜eZdZdZejejej	ej
eje
jejejejejejjejfZdd„Zedddd„ƒZedd	d
de j!ƒedd
dddƒedd	dddddƒddddd„ƒƒƒZ"dd„Z#edde$d	ddddd ƒed!d
ddd"d#ddd$ƒed%d
ddd&d#ddd'ƒd(ddd)d*„ƒƒƒZ%ed+d
ddd,dd-ƒdd.d/„ƒZ&d0d1„Z'ed2d	ddd3dd4ƒdd5d6„ƒZ(ed7d	d8d9d:dd;ƒed<d	d=d9ddd>ƒed?d	d@d9dddAƒedBd
dd#dddCddDƒed!d
dd#dddEƒdddddFdG„ƒƒƒƒƒZ)dS)HÚ
DbCommandsz%Class for managing the main database.cCsdS)Nr")rKr"r"r#Ú__init__“szDbCommands.__init__ZPropertyÚValuec	Cs&tj||gƒ}d|_x½t|jƒƒD]©\}}t|tƒr[tj|ƒ}|rÇt|tj	ƒrÇd|krÇ|j
ƒjdƒ}|}x=|D]}|j||gƒd}q¡Wq1|j||gƒq1Wtj
rttj|jƒƒƒnttj|jƒƒjƒƒdS)aPrint a `dict` as a table of two columns.

        :param dct: `dict` to print
        :param dict_property: name of the first column
        :param wrap: wrapping for the second column
        :param dict_value: header label for the value (second) column
        Úlz\nÚN)ÚprettytableÚPrettyTableZalignÚsortedruÚ
isinstanceÚdictÚsixÚ	text_typeÚstring_typesÚstripÚsplitÚadd_rowÚPY2r3rZsafe_encodeZ
get_stringÚdecode)	ÚdctZ
dict_propertyÚ
dict_valueÚptrnroÚlinesÚcol1Úliner"r"r#Ú_print_dict–s		$

	zDbCommands._print_dictz	--versionrAz	<version>rBz--local_cellrƒr„zEOnly sync db in the local cell: do not attempt to fan-outto all cellsÚversion2ÚVERSIONÚnargsú?zDatabase versionNFcCsù|r#|r#ttdƒƒ|}|sìtjƒ}yNtjj|tjjƒ}tj||ƒ}t	j
|d|ƒWdQRXWnftjk
rªttdƒƒYnBt
k
rë}z"ttdƒtj|ƒƒWYdd}~XnXt	j
|ƒS)z0Sync the database up to the most recent version.zªDEPRECATED: The '--version' parameter was deprecated in the Pike cycle and will not be supported in future versions of nova. Use the 'VERSION' positional argument insteadr
Nz5WARNING: cell0 mapping not found - not syncing cell0.a-ERROR: Could not access cell0.
Has the nova_api database been created?
Has the nova_cell0 database been created?
Has "nova-manage api_db sync" been run?
Has "nova-manage cell_v2 map_cell0" been run?
Is [api_database]/connection set in nova.conf?
Is the cell0 database connection URL correct?
Error: %s)r3rr
ÚRequestContextrÚCellMappingÚget_by_uuidÚ
CELL0_UUIDÚtarget_cellrÚdb_syncrÚCellMappingNotFoundrr“r”)rKrZ
local_cellr¢rWÚcell_mappingÚcctxtÚer"r"r#Úsyncµs 
*zDbCommands.synccCsttjƒƒdS)z#Print the current database version.N)r3rÚ
db_version)rKr"r"r#rÚszDbCommands.versionz
--max_rowsÚtypez<number>reÚmax_rowsz<Maximum number of deleted rows to archive. Defaults to 1000.z	--verboseÚverboser†z,Print how many rows were archived per table.z--until-completeÚuntil_completezfRun continuously until all deleted rows are archived. Use max_rows as a batch size for each iteration.iècCsut|ƒ}|dkr,ttdƒƒdS|tjkr\ttdƒdtjiƒdStjƒ}ytjj	|ƒWn)t
jk
r§ttdƒƒdSYnXi}g}|rÚ|rÚtj
jtdƒd	ƒxGytj|ƒ\}}Wn9tk
r1i}|r-|r-td
tdƒƒPYnXx>t|jƒƒD]*\}}	|j|dƒ|||	7<qEW|rß|jddƒ|jd
dƒtjj||ƒ}
|d|
7<tjj||ƒ}|d
|7<|séPn!|s
|r	td
tdƒƒP|rÝtj
jd
ƒqÝW|re|rU|j|tdƒdtdƒƒnttdƒƒtt|ƒƒS)aUMove deleted rows from production tables to shadow tables.

        Returns 0 if nothing was archived, 1 if some number of rows were
        archived, 2 if max_rows is invalid, 3 if no connection could be
        established to the API DB. If automating, this should be
        run continuously while the result is 1, stopping at 0.
        rz)Must supply a positive value for max_rowsr`z!max rows must be <= %(max_value)dZ	max_valuez®Failed to connect to API DB so aborting this archival attempt. Please check your config file to make sure that CONF.api_database.connection is set and run this command again.éZ	Archivingz..Ú.ÚstoppedÚinstance_mappingsZ
request_specsZcompleteZTablerœzNumber of Rows ArchivedzNothing was archived.)Úintr3rrZMAX_INTr
rIrÚCellMappingListÚget_allÚdb_excZCantStartEngineErrorr4ÚstdoutÚwriteÚarchive_deleted_rowsÚKeyboardInterruptrXruÚ
setdefaultÚInstanceMappingListZdestroy_bulkZRequestSpecr¡Úbool)rKr³r´rµrWZtable_to_rows_archivedZdeleted_instance_uuidsÚrunrnroZdeleted_mappingsZ
deleted_specsr"r"r#rÀÞsh	
		zDbCommands.archive_deleted_rowsz--deleterRzQIf specified, automatically delete any records found where instance_uuid is NULL.cCs§tj|ƒ}d}xut|jƒƒD]a\}}|r(d}|rittdƒd|d|iƒq(ttdƒd|d|iƒq(W|s£ttdƒƒdS)	z[Lists and optionally deletes database records where
        instance_uuid is NULL.
        FTz8Deleted %(records)d records from table '%(table_name)s'.ÚrecordsÚ
table_namezÈThere are %(records)d records in the '%(table_name)s' table where the uuid or instance_uuid column is NULL. Run this command again with the --delete option after you have backed up any necessary data.z9There were no records found where instance_uuid was NULL.N)rZdb_null_instance_uuid_scanrXrur3r)rKrRÚhitsZ
records_foundrÇrÆr"r"r#Únull_instance_uuid_scan.sz"DbCommands.null_instance_uuid_scanc
Csd}i}x|jD]õ}||}y|||ƒ\}}Wn9tk
rzttdƒtd|ƒƒd}}YnX|j}	|r°ttdƒd|d|	d|iƒ|j|	d	ƒ||	d|||	d|f||	<|dk	r||7}||krPqW|S)
Nrz"Error attempting to run %(method)sÚmethodz8%(total)i rows matched query %(meth)s, %(done)i migratedÚtotalÚmethÚdoner2)rr)Úonline_migrationsrr3rr’rYrÂ)
rKrWÚ	max_countÚranÚ
migrationsZmigration_methÚcountÚfoundrÍÚnamer"r"r#Ú_run_migrationKs0

	
zDbCommands._run_migrationz--max-countrÏz%Maximum number of objects to considerc
Cs‹tjƒ}|dk	rlyt|ƒ}Wntk
rBd}YnXd}|dkrŒttdƒƒdSn d}d}ttdƒ|ƒd}i}xg|dks³|dkr|j||ƒ}|j|ƒtd	d
„t	|j
ƒƒDƒƒ}|s›Pq›Wtjtdƒtdƒtd
ƒgƒ}xBt
|jƒƒD].}||}	|j||	d|	dgƒq?Wt|ƒ|r‡dpŠdS)Nr2Fz+Must supply a positive value for max_numberéTé2z$Running batches of %i until completercSsg|]\}}|‘qSr"r")rGrÓrÍr"r"r#rH}s	z5DbCommands.online_data_migrations.<locals>.<listcomp>Z	MigrationzTotal NeededZ	Completedéÿÿÿÿ)r
rIrºr;r3rrÕÚupdateÚsumrXÚvaluesrŽrrÚkeysr˜)
rKrÏrWZ	unlimitedrÐZmigration_inforÑÚtrÔÚinfor"r"r#Úonline_data_migrationsfs:

%	
"
z!DbCommands.online_data_migrationsz--resource_classz<class>ÚrequiredTz%Ironic node class to set on instancesz--hostz<host>z(Compute service name to migrate nodes onz--nodez<node>z8Ironic node UUID to migrate (all on the host if omitted)z--allÚ	all_hostsz-Run migrations for all ironic hosts and nodesz2Print information about migrations being performedcCs$|sttdƒƒdStjƒ}|rd|s8|rLttdƒƒdStjj|dƒ}n¦|r¶|r¶y%tjj|||ƒ}|g}Wq
t	j
k
r²g}Yq
XnT|röytjj||ƒ}Wq
t	j
k
ròg}Yq
XnttdƒƒdSt|ƒdkr0ttdƒƒdS|dj
dkrWttd	ƒƒdSxÆ|D]¾}tjj|d
|jddiƒ}	t|	ƒdkrµttd
ƒ|jƒdSt|	ƒdkr^tjj|||	djƒ}
|
r^|r^ttdƒd|	djd
|jiƒq^WdS)aÔMigrate flavor information for ironic instances.

        This will manually push the instance flavor migration required
        for ironic-hosted instances in Pike. The best way to accomplish
        this migration is to run your ironic computes normally in Pike.
        However, if you need to push the migration manually, then use
        this.

        This is idempotent, but not trivial to start/stop/resume. It is
        recommended that you do this with care and not from a script
        assuming it is trivial.

        Running with --all may generate a large amount of DB traffic
        all at once. Running at least one host at a time is recommended
        for batching.

        Return values:

        0: All work is completed (or none is needed)
        1: Specified host and/or node is not found, or no ironic nodes present
        2: Internal accounting error shows more than one instance per node
        3: Invalid combination of required arguments
        z7A resource_class is required for all modes of operationr¶z3--all with --host and/or --node does not make senser z7Either --all, --host, or --host and --node are requiredrz1No ironic compute nodes found that match criteriar2z/Compute node(s) specified is not of type ironicÚnodeZdeletedFz:Ironic node %s has multiple instances? Something is wrong.r`z+Migrated instance %(uuid)s on node %(node)sr{)r3rr
rIrÚComputeNodeListZget_by_hypervisor_typeZComputeNodeZget_by_host_and_nodenamerZComputeHostNotFoundÚget_all_by_hostrsZhypervisor_typeÚInstanceListÚget_by_filtersZhypervisor_hostnamer ZIronicDriverZ_pike_flavor_migration_for_noder{)rKZresource_classrVrârár´ÚctxZcnsZcnÚinstÚresultr"r"r#Úironic_flavor_migration‹sZ#	

		
z"DbCommands.ironic_flavor_migration)*rYrZr[r\rZ"migrate_instances_add_request_specÚkeypair_objZmigrate_keypairs_to_api_dbÚ
aggregate_objZmigrate_aggregatesZ%migrate_aggregate_reset_autoincrementÚinstance_group_objZ!migrate_instance_groups_to_api_dbÚbuild_request_objZ+delete_build_requests_with_no_instance_uuidrZ#service_uuids_online_data_migrationÚ
quotas_objZmigrate_quota_limits_to_api_dbZmigrate_quota_classes_to_api_dbÚsa_dbZmigration_migrate_to_uuidÚblock_device_objZBlockDeviceMappingZpopulate_uuidsÚinstance_objZ#populate_missing_availability_zonesrÎrŠr^r¡r_ÚargparseÚSUPPRESSr°rrºrÀrÉrÕrßrêr"r"r"r#r‰psd	 G#r‰c	@syeZdZdZdd„Zeddddejƒeddd	d
dddƒd
d
dd„ƒƒZdd„Z	d
S)Ú
ApiDbCommandsz$Class for managing the api database.cCsdS)Nr")rKr"r"r#rŠïszApiDbCommands.__init__z	--versionrAz	<version>rBr¢r£r¤r¥zDatabase versionNcCs6|r#|r#ttdƒƒ|}tj|ddƒS)z0Sync the database up to the most recent version.zªDEPRECATED: The '--version' parameter was deprecated in the Pike cycle and will not be supported in future versions of nova. Use the 'VERSION' positional argument insteadÚdatabaser)r3rrr«)rKrr¢r"r"r#r°òs
zApiDbCommands.synccCsttjddƒƒdS)z#Print the current database version.rörN)r3rr±)rKr"r"r#rÿszApiDbCommands.version)
rYrZr[r\rŠr_rórôr°rr"r"r"r#rõìsrõc@s~eZdZdZdZedd„ƒZddddd„Zedd	d
ddƒed
d	dddƒedd	dddƒedd	dddƒedd	dddƒedd	dddƒedd	dddƒedd	d dd!ƒed"d	d#ƒed$d	d#ƒd%ddddddddd&d'„	ƒƒƒƒƒƒƒƒƒƒZ	ed(d	d)dd*ƒd+d,„ƒZ
d-d.„ZdS)/ÚCellCommandsz-Commands for managing cells v1 functionality.zªDEPRECATED: The cell commands, which configure cells v1 functionality, are deprecated as Cells v1 itself has been deprecated. They will be removed in an upcoming release.cCsÒyžtj|ƒr|dfS|jdƒdkr_|jdddƒjdƒ\}}||fS|jdƒd	kr~|dfS|jdƒ\}}||fSWn-ttjfk
rÍtd|ƒd
SYnXdS)aParses the given server_string and returns a tuple of host and port.
        If it's not a combination of host part and port, the port element is an
        empty string. If the input is invalid expression, return a tuple of two
        empty strings.
        rz]:r2ú[ú:zInvalid server_string: %sNrØrØ)rr)r:Z
valid_ipv6ÚfindÚreplacer—r;ZAddrFormatErrorr3)Z
server_strrCÚportr"r"r#Ú_parse_server_string
s
$

z!CellCommands._parse_server_stringNcCsNg}|rÞ|jdƒ}x,|D]µ}|jƒ}|j|ƒ\}	}
|
sktdƒ|}t|ƒ‚yt|
ƒ}
Wn.tk
r«tdƒ|
}t|ƒ‚YnX|jtjd|	d|
d|d|ƒƒq"Wnlyt|ƒ}Wn.tk
rtdƒ|}t|ƒ‚YnX|jtjd|d|d|d|ƒƒ|S)	z7Returns a list of oslo.messaging.TransportHost objects.ú,zDInvalid broker_hosts value: %s. It should be in hostname:port formatz/Invalid port value: %s. It should be an integerÚhostnamerüÚusernameÚpasswordz,Invalid port value: %s. Should be an integer)	r—r–rýrr;rºÚappendÚ	messagingÚ
TransportHost)rKrrÚbroker_hostsrÿrüÚtransport_hostsÚhostsrVZbroker_hostnameZbroker_portÚmsgr"r"r#Ú_create_transport_hosts+sD
	
		
	
z$CellCommands._create_transport_hostsz--namerAz<name>rBzName for the new cellz--cell_typez<parent|api|child|compute>z/Whether the cell is parent/api or child/computez
--usernamez
<username>z,Username for the message broker in this cellz
--passwordz
<password>z,Password for the message broker in this cellz--broker_hostsz<broker_hosts>z¼Comma separated list of message brokers in this cell. Each Broker is specified as hostname:port with both mandatory. This option overrides the --hostname and --port options (if provided). z
--hostnamez
<hostname>z*Address of the message broker in this cellz--portz<number>z.Port number of the message broker in this cellz--virtual_hostz<virtual_host>z3The virtual host of the message broker in this cellz	--woffsetz<float>z--wscaleÚchildcCsÑ|dkrtdƒdS|j|||||ƒ}tjƒ}|jj|ƒ||_d}
|dkrrd}
d	|d
|
dtjt	|ƒƒdt
|	ƒd
t
|
ƒi}tjƒ}t
j||ƒdS)NÚparentr
rÚcomputez<Error: cell type must be 'parent'/'api' or 'child'/'compute'r`FTrÔÚ	is_parentÚ
transport_urlZ
weight_offsetZweight_scale)úparentzchildúapir)rr)r3r	rÚget_transport_urlrÚextendÚvirtual_hostr%ÚunquoterFÚfloatr
rIrZcell_create)rKrÔZ	cell_typerrrrÿrürZwoffsetZwscalerrr
rÛrWr"r"r#rPSs(
		zCellCommands.createz--cell_namez<cell_name>zName of the cell to deletecCs tjƒ}tj||ƒdS)N)r
rIrZcell_delete)rKZ	cell_namerWr"r"r#rR„szCellCommands.deletec
CsØtjƒ}tj|ƒ}d}t|dƒt|dƒx†|D]~}tj|jƒ}|jrr|jdn	t	j
ƒ}t||j|j|j
rŸdnd|j|j|j|jfƒqDWt|d"ƒdS)#Nz+%3s  %-10s  %-6s  %-10s  %-15s  %-5s  %-10sÚIdÚNameÚTypeÚUsernameÚHostnameÚPortÚVHostr!r¶é
ééérrr
)rzNamerrrrrú---ú
----------ú------ú
----------ú---------------ú-----ú
----------)r!r"r#r$r%r&r'ú---ú
----------ú------ú
----------ú---------------ú-----ú
----------)r(r)r*r+r,r-r.)r
rIrZcell_get_allr3rrrrrrr}rÔr
rrÿrür)rKrWÚcellsÚfmtÚcellr	rVr"r"r#rXŠs 
"zCellCommands.list)rYrZr[r\r]r^rýr	r_rPrRrXr"r"r"r#r÷s6'	0r÷c@sÒeZdZdZdd„Zdd„Zedddd	d
ddƒd
dd„ƒZedddddƒd
dd„ƒZd
dd„Z	dd„Z
edddd	dddddƒeddd d	d!dd"ƒd
d#d$„ƒƒZd
d%d&d'„Zedddd	d
ddƒed(dd)dd*ƒed+d,d-dd.ƒd
d
d%d/d0„ƒƒƒZ
ed1dd2d	d3ddded4ƒƒed5d,d-d	d6ded7ƒƒd%d8d9„ƒƒZedddd	ddd:ƒed+d,d-ded;ƒƒed<d,d-ded=ƒƒed>d,d-d?d%d	d@dedAƒƒd
d%d%d%dBdC„ƒƒƒƒZeedDƒƒed(dd)ded*ƒƒedddd	dEdedFƒƒedddd	d
dedƒƒed+d,d-dedGƒƒd
d
d
d%dHdI„ƒƒƒƒƒZed+d,d-dedJƒƒd%dKdL„ƒZedMd,d-d?d%dedNƒƒedddd	ddddedOƒƒd%dPdQ„ƒƒZedddd	ddddedRƒƒed(dd)d	dSdedTƒƒedddd	d
dedUƒƒedddd	dVdedWƒƒd
d
d
dXdY„ƒƒƒƒZedddd	ddedZƒƒd
d[d\„ƒZedddd	ddddedZƒƒed]dd^d	d_ddded`ƒƒdadb„ƒƒZd
S)cÚCellV2CommandszCommands for managing cells v2.cCs#|ptj}|stdƒ|S)Nz]Must specify --transport-url if [DEFAULT]/transport_url is not set in the configuration file.)rJrr3)rKrr"r"r#Ú_validate_transport_url s
z&CellV2Commands._validate_transport_urlcCsuxntjj|ƒD]Z}|r4|j|jkr4q|j|ksR|j|krttdƒ|jƒdSqWdS)NzpThe specified transport_url and/or database_connection combination already exists for another cell with uuid %s.TF)rr»r¼r{Údatabase_connectionrr3r)rKrWr­rr4r1r"r"r#Ú5_non_unique_transport_url_database_connection_checker§szDCellV2Commands._non_unique_transport_url_database_connection_checkerz--transport-urlrAz<transport_url>rerrBz,The transport url for the cell message queueNcCs4tjjrtdƒdS|j|ƒ}|s3dStjƒ}y|jƒ}Wn@tj	k
r‘tt
dƒƒtjj
|tjjƒ}YnXtj||ƒ]}ytjdd|ƒWn<tjk
rü}ztt
dƒ|ƒWYdd}~XnXWdQRX|j|ƒ}|dkr#dS|j|ƒdS)	a}Simple cellsv2 setup.

        This simplified command is for use by existing non-cells users to
        configure the default environment. If you are using CellsV1, this
        will not work for you. Returns 0 if setup is completed (or has
        already been done), 1 if no hosts are reporting (and this cannot
        be mapped) and 2 if run in a CellsV1 environment.
        z6CellsV1 users cannot use this simplified setup commandr`r2zCell0 is already setupNr
zUnable to sync cell0 schema: %sr)rJr/Úenabler3r3r
r¦Ú
_map_cell0r½ÚDBDuplicateEntryrrr§r¨r©rªrr«ZDBErrorÚ_map_cell_and_hostsÚ
map_instances)rKrrWZ
cell0_mappingr®ÚexÚ	cell_uuidr"r"r#Úsimple_cell_setup¶s.
	.
z CellV2Commands.simple_cell_setupz--database_connectionz<database_connection>z¸The database connection url for cell0. This is optional. If not provided, a standard database connection will be used based on the main database connection from the Nova configuration.cCs@y|jd|ƒWn%tjk
r;ttdƒƒYnXdS)a°Create a cell mapping for cell0.

        cell0 is used for instances that have not been scheduled to any cell.
        This generally applies to instances that have encountered an error
        before they have been scheduled.

        This command creates a cell mapping for this special cell which
        requires a database to store the instance data.

        Returns 0 if cell0 created successfully or already setup.
        r4zCell0 is already setupr)r7r½r8r3r)rKr4r"r"r#Ú	map_cell0Þs
zCellV2Commands.map_cell0c
Csbdd„}|p|ƒ}tjƒ}tj|dtjjddddd|ƒ}|jƒ|S)	zXFaciliate creation of a cell mapping for cell0.
        See map_cell0 for more.
        cSs>tjj}tj|ƒ}|jd|_tjt|ƒƒS)NZ_cell0)rJröÚ
connectionÚsqla_urlZmake_urlr%rrF)r?r	r"r"r#Úcell0_default_connectionûsz;CellV2Commands._map_cell0.<locals>.cell0_default_connectionr{rÔZcell0rznone:///r4)r
r¦rr§r©rP)rKr4rAZdbcrWr­r"r"r#r7÷s	
zCellV2Commands._map_cell0c
Csi}tj||ƒ@}tjj|jddƒ|ddddd|d|ƒ}WdQRXxg|D]_}y>tj|ƒ}	|j|	_||	_	|j
|	_
|	jƒWqbtj
k
rÀwbYqbXqbWt|ƒd	ksét|ƒ|kròd}n
|dj}|S)NÚread_deletedÚyesZsort_keyZ
created_atZsort_dirZascÚlimitÚmarkerrr2rØ)r
rªrråræÚelevatedÚInstanceMappingr{rTr­rUrPr½r8rs)
rKrWr­rDrEÚfiltersr®Ú	instancesrÚmappingr"r"r#Ú_get_and_map_instancess&	
	$	
z%CellV2Commands._get_and_map_instancesz--cell_uuidz<cell_uuid>r<ràTzGUnmigrated instances will be mapped to the cell with the uuid provided.z--max-countz<max_count>rÏzáMaximum number of instances to map. If not set, all instances in the cell will be mapped in batches of 50. If you have a large number of instances, consider specifying a custom value and run the command until it exits with 0.c
Csg|dk	r`yt|ƒ}Wntk
r6d}YnXd}|dkrlttdƒƒdSnd}d}tjƒ}d}tjj||ƒ}tj	j
||ƒ}t|ƒd	krÃd}n'|d	jj
d
dƒ}|d	jƒd}	x5|	dk	r'|j||||ƒ}	|	}|sóPqóW|	rc|	j
dd
ƒ}	tj|d|	d
|ƒjƒdSd	S)a>Map instances into the provided cell.

        Instances in the nova database of the provided cell (nova database
        info is obtained from the nova-api database) will be queried from
        oldest to newest and if unmapped, will be mapped to the provided cell.
        A max-count can be set on the number of instance to map in a single
        run. Repeated runs of the command will start from where the last run
        finished so it is not necessary to increase max-count to finish. An
        exit code of 0 indicates that all instances have been mapped.
        Nr2Fz*Must supply a positive value for max-countrÖTr×ZINSTANCE_MIGRATION_MARKERrú r!rTrUrØ)rºr;r3rr
r¦rr§r¨rÃZget_by_project_idrsrTrûÚdestroyrKrGrP)
rKr<rÏZmap_allrWZmarker_project_idr­Zmarker_mappingrEZnext_markerr"r"r#r:0sB
		
zCellV2Commands.map_instancesFcCs¯tjƒ}d}}tjj|ƒ}|sBttdƒƒdStƒ}x|D]…}	ytjj	||	j
ƒ}
Wn%tjk
r›|j
|	j
ƒYqRX|rËttdƒd|
j
d|
jjiƒ|
jj}qRW|sõttdƒƒ|S|dk	rtjj||ƒ}|dkretjƒ}tj|d|d|d|dtjjƒ}|jƒx3|D]+}tj|d|d	|ƒ}
|
jƒqlW|r«t|ƒ|S)
Nz'No hosts found to map to cell, exiting.z0Host %(host)s is already mapped to cell %(uuid)srVr{z1All hosts are already mapped to cell(s), exiting.rÔrr4r­)r
r¦rrãr¼r3rÚsetÚHostMappingÚget_by_hostrVrÚHostMappingNotFoundÚaddr­r{r§r¨rÚ
generate_uuidrJrör?rP)rKrrÔr´rWÚcell_mapping_uuidr­Z
compute_nodesZ
missing_nodesZcompute_noderZcompute_hostr"r"r#r9ssN
	
			


z"CellV2Commands._map_cell_and_hostsz--namez<cell_name>zThe name of the cellz	--verboserƒr„z8Output the cell mapping uuid for any newly mapped hosts.cCs0|j|ƒ}|sdS|j|||ƒdS)aªEXPERIMENTAL. Create a cell mapping and host mappings for a cell.

        Users not dividing their cloud into multiple cells will be a single
        cell v2 deployment and should specify:

          nova-manage cell_v2 map_cell_and_hosts --config-file <nova.conf>

        Users running multiple cells can add a cell v2 by specifying:

          nova-manage cell_v2 map_cell_and_hosts --config-file <cell nova.conf>
        r2r)r3r9)rKrrÔr´r"r"r#Úmap_cell_and_hosts¥s
z!CellV2Commands.map_cell_and_hostsz--uuidz<instance_uuid>r{zThe instance UUID to verifyz--quietÚquietzDo not print anythingc	"s~‡fdd†}tjƒ}ytjj||ƒ}Wn'tjk
r`|d|ƒdSYnX|jdkr‚|d|ƒdStj||jƒ¹}ytj	j
||ƒ}Wn–tjk
rKyM|jdd	ƒ}tj	j
||ƒ}|r|d
|ƒ|dƒdSWn1tjk
rF|d
|ƒ|dƒdSYnXYnXWdQRX|d||jj
|jjfƒdSdS)ajVerify instance mapping to a cell.

        This command is useful to determine if the cellsv2 environment is
        properly setup, specifically in terms of the cell, host, and instance
        mapping records required.

        This prints one of three strings (and exits with a code) indicating
        whether the instance is successfully mapped to a cell (0), is unmapped
        due to an incomplete upgrade (1), unmapped due to normally transient
        state (2), it is a deleted instance which has instance mapping (3),
        or it is an archived instance which still has an instance mapping (4).
        csˆst|ƒdS)N)r3)Ústring)rVr"r#ÚsayÐsz+CellV2Commands.verify_instance.<locals>.sayzVInstance %s is not mapped to a cell (upgrade is incomplete) or instance does not existr2Nz#Instance %s is not mapped to a cellr`rBrCz+The instance with uuid %s has been deleted.zuExecute `nova-manage db archive_deleted_rows`command to archive this deleted instance andremove its instance_mapping.r¶z,The instance with uuid %s has been archived.z%However its instance_mapping remains.r8zInstance %s is in cell: %s (%s)r)r
rIrrGZget_by_instance_uuidrZInstanceMappingNotFoundr­rªZInstancer¨ZInstanceNotFoundrFrÔr{)	rKr{rVrXrWrJr®rZel_ctxr")rVr#Úverify_instance¿sD		

	zCellV2Commands.verify_instancezAIf provided only this cell will be searched for new hosts to map.z/Provide detailed output when discovering hosts.z--strictz‹Considered successful (exit code 0) only when an unmapped host is discovered. Any other outcome will be considered a failure (exit code 1).z--by-servicer†Ú
by_servicez1Discover hosts by service instead of compute nodecsK‡fdd†}tjƒ}tj||||ƒ}|rGt|ƒSdS)axSearches cells, or a single cell, and maps found hosts.

        When a new host is added to a deployment it will add a service entry
        to the db it's configured to use. This command will check the db for
        each cell, or a single one if passed in, and map any hosts which are
        not currently mapped. If a host is already mapped nothing will be done.
        csˆrt|ƒdS)N)r3)r)r´r"r#Ú	status_fnsz0CellV2Commands.discover_hosts.<locals>.status_fnN)r
r¦Úhost_mapping_objÚdiscover_hostsrº)rKr<r´ÚstrictrZr[rWrr")r´r#r]ýs	zCellV2Commands.discover_hostsz‚Add a new cell to nova API database. DB and MQ urls can be provided directly or can be taken from config. The result is cell uuid.r4z&The database url for the cell databasez#Output the uuid of the created cellc
CsÎtjƒ}|ptj}|s5ttdƒƒdS|pDtjj}|sattdƒƒdS|j|d||ƒr}dSt	j
ƒ}tj|d|d|d|d|ƒ}|j
ƒ|rÊt|ƒd	S)
Nz]Must specify --transport-url if [DEFAULT]/transport_url is not set in the configuration file.r2zaMust specify --database_connection if [database]/connection is not set in the configuration file.r`r{rÔrr4r)r
Úget_contextrJrr3rrör?r5rrSrr§rP)rKrÔr4rr´rWrTr­r"r"r#Úcreate_cells,		

zCellV2Commands.create_cellz)Show sensitive details, such as passwordscCsètjjtjƒƒ}tdƒtdƒtdƒtdƒg}tj|ƒ}x†t|ddd„ƒD]l}|j	|j
g}|r¤|j|j|j
gƒn%|jt|jƒt|j
ƒgƒ|j|ƒqjWt|ƒdS)	zÀLists the v2 cells in the deployment.

        By default only the cell name and uuid are shown. Use the --verbose
        option to see transport URL and database connection details.
        rZUUIDz
Transport URLzDatabase ConnectionÚkeycSs|jS)N)rÔ)Z_cellr"r"r#Ú<lambda>Tsz+CellV2Commands.list_cells.<locals>.<lambda>r)rr»r¼r
rIrrŽrrrÔr{rrr4r1r˜r3)rKr´Z
cell_mappingsÚfield_namesrÝr1Úfieldsr"r"r#Ú
list_cellsEs	
zCellV2Commands.list_cellsz--forcez-Delete hosts that belong to the cell as well.zThe uuid of the cell to delete.cCs¤tjƒ}ytjj||ƒ}Wn-tjk
rTttdƒ|ƒdSYnXtj	j
||jƒ}g}|rÅ|s—ttdƒ|ƒdStj||ƒ}tj
j|ƒ}WdQRXtjj
||jƒ}|rWtj||ƒ}tjj|ƒ}	WdQRX|	r/ttdƒ|ƒdSttdƒ|ƒttd	ƒƒd
Sx!|D]}
d|
_|
jƒq^Wx|D]}|jƒq‚W|jƒdS)aDelete an empty cell by the given uuid.

        This command will return a non-zero exit code in the following cases.

        * The cell is not found by uuid.
        * It has hosts and force is False.
        * It has instance mappings.

        If force is True and the cell has host, hosts are deleted as well.

        Returns 0 in the following cases.

        * The empty cell is found and deleted successfully.
        * The cell has hosts and force is True and the cell and the hosts are
          deleted successfully.
        z Cell with uuid %s was not found.r2z5There are existing hosts mapped to cell with uuid %s.r`Nz9There are existing instances mapped to cell with uuid %s.r¶zbThere are instance mappings to cell with uuid %s, but all instances have been deleted in the cell.zQSo execute 'nova-manage db archive_deleted_rows' to delete the instance mappings.r8r)r
rIrr§r¨rr¬r3rÚHostMappingListÚget_by_cell_idr}rªrãr¼rÃråÚmappedÚsaverM)rKr<ÚforcerWr­Ú
host_mappingsÚnodesr®r¹rIrârr"r"r#Údelete_cell`sH			
	

zCellV2Commands.delete_cellzThe uuid of the cell to update.rÔzSet the cell name.zZSet the cell transport_url. NOTE that running nodes will not see the change until restart!Ú
db_connectionz`Set the cell database_connection. NOTE that running nodes will not see the change until restart!cCstjƒ}ytjj||ƒ}Wn-tjk
rTttdƒ|ƒdSYnX|rd||_	|ppt
j}|p‚t
jj
}|j||||ƒr¡dS|r°||_|r¿||_y|jƒWn=tk
r}zttdƒ|ƒdSWYdd}~XnXdS)aaUpdates the properties of a cell by the given uuid.

        If the cell is not found by uuid, this command will return an exit
        code of 1. If the provided transport_url or/and database_connection
        is/are same as another cell, this command will return an exit code
        of 3. If the properties cannot be set, this will return 2.
        Otherwise, the exit code will be 0.

        NOTE: Updating the transport_url or database_connection fields on
        a running system will NOT result in all nodes immediately using the
        new values. Use caution when changing these values.
        z Cell with uuid %s was not found.r2r¶z Unable to update CellMapping: %sr`Nr)r
rIrr§r¨rr¬r3rrÔrJrrör?r5r4rir)rKr<rÔrrnrWr­r¯r"r"r#Úupdate_cell­s.					zCellV2Commands.update_cellzThe uuid of the cell.c	
Cstjƒ}|rvytjj||ƒ}Wn-tjk
rZttdƒ|ƒdSYnXtj	j
||jƒ}ntj	j|ƒ}tdƒtdƒtdƒg}t
j|ƒ}xKt|ddd„ƒD]1}|jj|jj|jg}|j|ƒqÑWt|ƒd	S)
z'Lists the hosts in one or all v2 cells.z Cell with uuid %s was not found.r2z	Cell Namez	Cell UUIDrracSs|jS)N)rV)Z_hostr"r"r#rbüsz+CellV2Commands.list_hosts.<locals>.<lambda>r)r
rIrr§r¨rr¬r3rrfrgr}r¼rŽrrr­rÔr{rVr˜)	rKr<rWr­rkrcrÝrVrdr"r"r#Ú
list_hostsçs$		!
zCellV2Commands.list_hostsz--hostz<host>rVzThe host to delete.c
Csmtjƒ}ytjj||ƒ}Wn-tjk
rTttdƒ|ƒdSYnXytj	j
||ƒ}Wn-tjk
rttdƒ|ƒdSYnX|jj
|j
kr×ttdƒd|d|iƒdStj||ƒ1}tjj
||ƒ}tjj||ƒ}Wd	QRX|r;ttd
ƒ|ƒdSx!|D]}	d|	_|	jƒqBW|jƒdS)
aoDelete a host in a cell (host mappings) by the given host name

        This command will return a non-zero exit code in the following cases.

        * The cell is not found by uuid.
        * The host is not found by host name.
        * The host is not in the cell.
        * The host has instances.

        Returns 0 if the host is deleted successfully.
        z Cell with uuid %s was not found.r2zThe host %s was not found.r`z:The host %(host)s was not found in the cell %(cell_uuid)s.rVr<r¶Nz#There are instances on the host %s.r8r)r
rIrr§r¨rr¬r3rrOrPrQr­r{rªrårãrärhrirM)
rKr<rVrWr­rr®rIrlrâr"r"r#Údelete_hosts6		
	
zCellV2Commands.delete_host)rYrZr[r\r3r5r_r=r>r7rKr:r9rUrrYr]Úaction_descriptionr`rermrorprqr"r"r"r#r2sž&	 :2:	!I.r2Zapi_dbr1Zcell_v2rZfloatingr€Ú
categoriesÚcategoryÚtitlezCommand categoriesrBzAvailable categoriesÚhandlerzpost-mortemr†FzAllow post-mortem debuggingcCs/tjttgƒtjtjƒtj	dtj
ƒtƒtjtdƒt
jƒtjjdkr}ttjƒƒdStjjdkr tjtƒdSy6tjƒ\}}}|||Ž}tjƒ|SWnRtk
r*tjrddl}|jƒnttdƒtjƒƒdSYnXdS)	z4Parse options and call the appropriate class/method.Zdefault_log_levelsÚnovarrzbash-completionNzAn error has occurred:
%sr2) rJZregister_cli_optsÚcategory_optÚpost_mortem_optrÚ
parse_argsr4ÚargvÚloggingÚset_defaultsZget_default_log_levelsÚ_EXTRA_DEFAULT_LOG_LEVELSÚsetuprZregister_allrtrÔr3rZversion_string_with_packageÚ
cmd_commonZprint_bash_completionÚ
CATEGORIESZ
get_action_fnrÚcleanuprZpost_mortemÚpdbrÚ	tracebackÚ
format_exc)ÚfnZfn_argsZ	fn_kwargsÚretrƒr"r"r#ÚmainOs0		



	
rˆ)er\Ú
__future__rróÚ	functoolsr&r4r„Ú	decoratorr:Zoslo_configrZoslo_dbrr½Zoslo_logrr|Zoslo_messagingrZ
oslo_utilsrrrrŽr“Zsix.moves.urllib.parseÚmovesÚurllibÚparser%Zsqlalchemy.enginer	r@Znova.api.ec2r
Znova.cmdrr€Z	nova.confrwrr
rZnova.dbrZnova.db.sqlalchemyrrðZ	nova.i18nrrZnova.objectsrrìrrñrrîrr\rròrrírrërrïrrrrrZ	nova.virtr ÚconfrJZQUOTASr~r_rrr$r1r6Úobjectr7rcrdr‰rõr÷r2rÚpartialZadd_command_parsersZ
SubCommandOptrxZBoolOptryrˆr"r"r"r#Ú<module>s 				

^
¤ÿ}™ÿÿ