a
This commit is contained in:
		
					parent
					
						
							
								a2605ba3d2
							
						
					
				
			
			
				commit
				
					
						81d7e796b2
					
				
			
		
					 5 changed files with 115 additions and 16 deletions
				
			
		
							
								
								
									
										5
									
								
								.vscode/settings.json
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.vscode/settings.json
									
										
									
									
										vendored
									
									
								
							|  | @ -1,3 +1,6 @@ | ||||||
| { | { | ||||||
|     "python.pythonPath": "/home/meow/.local/share/virtualenvs/ucloud-setup-20frMi5h/bin/python" |     "python.pythonPath": "/home/meow/.local/share/virtualenvs/ucloud-setup-20frMi5h/bin/python", | ||||||
|  |     "python.linting.pylintEnabled": false, | ||||||
|  |     "python.linting.enabled": true, | ||||||
|  |     "python.linting.prospectorEnabled": true | ||||||
| } | } | ||||||
							
								
								
									
										1
									
								
								Pipfile
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								Pipfile
									
										
									
									
									
								
							|  | @ -5,6 +5,7 @@ verify_ssl = true | ||||||
| 
 | 
 | ||||||
| [dev-packages] | [dev-packages] | ||||||
| pylint = "*" | pylint = "*" | ||||||
|  | prospector = "*" | ||||||
| 
 | 
 | ||||||
| [packages] | [packages] | ||||||
| click = "*" | click = "*" | ||||||
|  |  | ||||||
							
								
								
									
										105
									
								
								Pipfile.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										105
									
								
								Pipfile.lock
									
										
									
										generated
									
									
									
								
							|  | @ -1,7 +1,7 @@ | ||||||
| { | { | ||||||
|     "_meta": { |     "_meta": { | ||||||
|         "hash": { |         "hash": { | ||||||
|             "sha256": "4d5c60b0647d0f065ccb6c1c7cc271c5fb0204f5e1d5e3cdfc2d7419185bc959" |             "sha256": "846ff5d78c8417b913f0ec6814d255c35e3c3fb238ac4f2dca169ed4c13db30f" | ||||||
|         }, |         }, | ||||||
|         "pipfile-spec": 6, |         "pipfile-spec": 6, | ||||||
|         "requires": { |         "requires": { | ||||||
|  | @ -166,6 +166,12 @@ | ||||||
|             ], |             ], | ||||||
|             "version": "==2.2.5" |             "version": "==2.2.5" | ||||||
|         }, |         }, | ||||||
|  |         "dodgy": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:65e13cf878d7aff129f1461c13cb5fd1bb6dfe66bb5327e09379c3877763280c" | ||||||
|  |             ], | ||||||
|  |             "version": "==0.1.9" | ||||||
|  |         }, | ||||||
|         "isort": { |         "isort": { | ||||||
|             "hashes": [ |             "hashes": [ | ||||||
|                 "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1", |                 "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1", | ||||||
|  | @ -203,6 +209,41 @@ | ||||||
|             ], |             ], | ||||||
|             "version": "==0.6.1" |             "version": "==0.6.1" | ||||||
|         }, |         }, | ||||||
|  |         "pep8-naming": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:1b419fa45b68b61cd8c5daf4e0c96d28915ad14d3d5f35fcc1e7e95324a33a2e", | ||||||
|  |                 "sha256:4eedfd4c4b05e48796f74f5d8628c068ff788b9c2b08471ad408007fc6450e5a" | ||||||
|  |             ], | ||||||
|  |             "version": "==0.4.1" | ||||||
|  |         }, | ||||||
|  |         "prospector": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:aba551e53dc1a5a432afa67385eaa81d7b4cf4c162dc1a4d0ee00b3a0712ad90" | ||||||
|  |             ], | ||||||
|  |             "index": "pypi", | ||||||
|  |             "version": "==1.1.7" | ||||||
|  |         }, | ||||||
|  |         "pycodestyle": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:cbc619d09254895b0d12c2c691e237b2e91e9b2ecf5e84c26b35400f93dcfb83", | ||||||
|  |                 "sha256:cbfca99bd594a10f674d0cd97a3d802a1fdef635d4361e1a2658de47ed261e3a" | ||||||
|  |             ], | ||||||
|  |             "version": "==2.4.0" | ||||||
|  |         }, | ||||||
|  |         "pydocstyle": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:04c84e034ebb56eb6396c820442b8c4499ac5eb94a3bda88951ac3dc519b6058", | ||||||
|  |                 "sha256:66aff87ffe34b1e49bff2dd03a88ce6843be2f3346b0c9814410d34987fbab59" | ||||||
|  |             ], | ||||||
|  |             "version": "==4.0.1" | ||||||
|  |         }, | ||||||
|  |         "pyflakes": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f", | ||||||
|  |                 "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805" | ||||||
|  |             ], | ||||||
|  |             "version": "==1.6.0" | ||||||
|  |         }, | ||||||
|         "pylint": { |         "pylint": { | ||||||
|             "hashes": [ |             "hashes": [ | ||||||
|                 "sha256:5d77031694a5fb97ea95e828c8d10fc770a1df6eb3906067aaed42201a8a6a09", |                 "sha256:5d77031694a5fb97ea95e828c8d10fc770a1df6eb3906067aaed42201a8a6a09", | ||||||
|  | @ -211,6 +252,61 @@ | ||||||
|             "index": "pypi", |             "index": "pypi", | ||||||
|             "version": "==2.3.1" |             "version": "==2.3.1" | ||||||
|         }, |         }, | ||||||
|  |         "pylint-celery": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:41e32094e7408d15c044178ea828dd524beedbdbe6f83f712c5e35bde1de4beb" | ||||||
|  |             ], | ||||||
|  |             "version": "==0.3" | ||||||
|  |         }, | ||||||
|  |         "pylint-django": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:75c69d1ec2275918c37f175976da20e2f1e1e62e067098a685cd263ffa833dfd", | ||||||
|  |                 "sha256:c7cb6384ea7b33ea77052a5ae07358c10d377807390ef27b2e6ff997303fadb7" | ||||||
|  |             ], | ||||||
|  |             "version": "==2.0.10" | ||||||
|  |         }, | ||||||
|  |         "pylint-flask": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:f4d97de2216bf7bfce07c9c08b166e978fe9f2725de2a50a9845a97de7e31517" | ||||||
|  |             ], | ||||||
|  |             "version": "==0.6" | ||||||
|  |         }, | ||||||
|  |         "pylint-plugin-utils": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:8d9e31d5ea8b7b0003e1f0f136b44a5235896a32e47c5bc2ef1143e9f6ba0b74" | ||||||
|  |             ], | ||||||
|  |             "version": "==0.5" | ||||||
|  |         }, | ||||||
|  |         "pyyaml": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:0113bc0ec2ad727182326b61326afa3d1d8280ae1122493553fd6f4397f33df9", | ||||||
|  |                 "sha256:01adf0b6c6f61bd11af6e10ca52b7d4057dd0be0343eb9283c878cf3af56aee4", | ||||||
|  |                 "sha256:5124373960b0b3f4aa7df1707e63e9f109b5263eca5976c66e08b1c552d4eaf8", | ||||||
|  |                 "sha256:5ca4f10adbddae56d824b2c09668e91219bb178a1eee1faa56af6f99f11bf696", | ||||||
|  |                 "sha256:7907be34ffa3c5a32b60b95f4d95ea25361c951383a894fec31be7252b2b6f34", | ||||||
|  |                 "sha256:7ec9b2a4ed5cad025c2278a1e6a19c011c80a3caaac804fd2d329e9cc2c287c9", | ||||||
|  |                 "sha256:87ae4c829bb25b9fe99cf71fbb2140c448f534e24c998cc60f39ae4f94396a73", | ||||||
|  |                 "sha256:9de9919becc9cc2ff03637872a440195ac4241c80536632fffeb6a1e25a74299", | ||||||
|  |                 "sha256:a5a85b10e450c66b49f98846937e8cfca1db3127a9d5d1e31ca45c3d0bef4c5b", | ||||||
|  |                 "sha256:b0997827b4f6a7c286c01c5f60384d218dca4ed7d9efa945c3e1aa623d5709ae", | ||||||
|  |                 "sha256:b631ef96d3222e62861443cc89d6563ba3eeb816eeb96b2629345ab795e53681", | ||||||
|  |                 "sha256:bf47c0607522fdbca6c9e817a6e81b08491de50f3766a7a0e6a5be7905961b41", | ||||||
|  |                 "sha256:f81025eddd0327c7d4cfe9b62cf33190e1e736cc6e97502b3ec425f574b3e7a8" | ||||||
|  |             ], | ||||||
|  |             "version": "==5.1.2" | ||||||
|  |         }, | ||||||
|  |         "requirements-detector": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:9fbc4b24e8b7c3663aff32e3eba34596848c6b91bd425079b386973bd8d08931" | ||||||
|  |             ], | ||||||
|  |             "version": "==0.6" | ||||||
|  |         }, | ||||||
|  |         "setoptconf": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:5b0b5d8e0077713f5d5152d4f63be6f048d9a1bb66be15d089a11c898c3cf49c" | ||||||
|  |             ], | ||||||
|  |             "version": "==0.2.0" | ||||||
|  |         }, | ||||||
|         "six": { |         "six": { | ||||||
|             "hashes": [ |             "hashes": [ | ||||||
|                 "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", |                 "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", | ||||||
|  | @ -218,6 +314,13 @@ | ||||||
|             ], |             ], | ||||||
|             "version": "==1.12.0" |             "version": "==1.12.0" | ||||||
|         }, |         }, | ||||||
|  |         "snowballstemmer": { | ||||||
|  |             "hashes": [ | ||||||
|  |                 "sha256:9f3b9ffe0809d174f7047e121431acf99c89a7040f0ca84f94ba53a498e6d0c9", | ||||||
|  |                 "sha256:e96a78635eca95b5cc32eec15a98edd5380bea6245bd94ab7b62ddcef66faafd" | ||||||
|  |             ], | ||||||
|  |             "version": "==1.9.0" | ||||||
|  |         }, | ||||||
|         "typed-ast": { |         "typed-ast": { | ||||||
|             "hashes": [ |             "hashes": [ | ||||||
|                 "sha256:18511a0b3e7922276346bcb47e2ef9f38fb90fd31cb9223eed42c85d1312344e", |                 "sha256:18511a0b3e7922276346bcb47e2ef9f38fb90fd31cb9223eed42c85d1312344e", | ||||||
|  |  | ||||||
							
								
								
									
										16
									
								
								app/ceph.py
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								app/ceph.py
									
										
									
									
									
								
							|  | @ -1,25 +1,13 @@ | ||||||
| import click | import click | ||||||
| import subprocess |  | ||||||
| import os |  | ||||||
| import shutil |  | ||||||
| import pysftp | import pysftp | ||||||
| 
 | 
 | ||||||
| from app.helper import ( |  | ||||||
|     clone, |  | ||||||
|     clone_common, |  | ||||||
|     clone_etcd_wrapper, |  | ||||||
|     GitOperation, |  | ||||||
|     PipenvOperation, |  | ||||||
|     FileOperation, |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| @click.group() | @click.group() | ||||||
| def host(): | def ceph(): | ||||||
|     pass |     pass | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @host.command("setup") | @ceph.command("setup") | ||||||
| @click.option("--ceph_url", required=True) | @click.option("--ceph_url", required=True) | ||||||
| @click.option("--ssh_username", required=True) | @click.option("--ssh_username", required=True) | ||||||
| @click.option("--ssh_key_path", required=True, help="For Example, ~/.ssh/id_rsa") | @click.option("--ssh_key_path", required=True, help="For Example, ~/.ssh/id_rsa") | ||||||
|  |  | ||||||
|  | @ -4,17 +4,21 @@ from app.scheduler import scheduler | ||||||
| from app.host import host | from app.host import host | ||||||
| from app.image import image | from app.image import image | ||||||
| from app.file import file_scan | from app.file import file_scan | ||||||
|  | from app.ceph import ceph | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @click.group() | @click.group() | ||||||
| def entry_point(): | def entry_point(): | ||||||
|     pass |     pass | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| entry_point.add_command(api) | entry_point.add_command(api) | ||||||
| entry_point.add_command(scheduler) | entry_point.add_command(scheduler) | ||||||
| entry_point.add_command(host) | entry_point.add_command(host) | ||||||
| entry_point.add_command(image) | entry_point.add_command(image) | ||||||
| entry_point.add_command(file_scan) | entry_point.add_command(file_scan) | ||||||
|  | entry_point.add_command(ceph) | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||||
|     entry_point() |     entry_point() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue