Add support for password assignation on customized images
Change-Id: I5014ab242ec5d1fef604a2c1c9a29648d5e4f5bd
This commit is contained in:
parent
af377b71ac
commit
0845507019
@ -431,6 +431,9 @@ class CustomizedGlanceImageFixture(URLGlanceImageFixture):
|
|||||||
def write_files(self) -> typing.Dict[str, str]:
|
def write_files(self) -> typing.Dict[str, str]:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
username: str = ''
|
||||||
|
password: str = ''
|
||||||
|
|
||||||
def customize_image_file(self, base_file: str) -> str:
|
def customize_image_file(self, base_file: str) -> str:
|
||||||
customized_file = base_file + '.1'
|
customized_file = base_file + '.1'
|
||||||
if os.path.isfile(customized_file):
|
if os.path.isfile(customized_file):
|
||||||
@ -468,6 +471,11 @@ class CustomizedGlanceImageFixture(URLGlanceImageFixture):
|
|||||||
if install_packages:
|
if install_packages:
|
||||||
options += ['--install', ','.join(install_packages)]
|
options += ['--install', ','.join(install_packages)]
|
||||||
|
|
||||||
|
username = self.username
|
||||||
|
password = self.password
|
||||||
|
if username and password:
|
||||||
|
options += f'--password "{username}:password:{password}"'
|
||||||
|
|
||||||
run_commands = self.run_commands
|
run_commands = self.run_commands
|
||||||
if run_commands:
|
if run_commands:
|
||||||
for cmd in run_commands:
|
for cmd in run_commands:
|
||||||
|
Loading…
Reference in New Issue
Block a user