Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-image-creator
Commits
94639eba
Commit
94639eba
authored
Jun 16, 2014
by
Nikos Skalkotos
Browse files
windows: Add systemroot as a member in Windows
It is used many cases and it is better if we cache it.
parent
050dfede
Changes
1
Hide whitespace changes
Inline
Side-by-side
image_creator/os_type/windows/__init__.py
View file @
94639eba
...
...
@@ -165,6 +165,8 @@ class Windows(OSBase):
self
.
last_part_num
=
self
.
image
.
g
.
part_list
(
device
)[
-
1
][
'part_num'
]
self
.
product_name
=
self
.
image
.
g
.
inspect_get_product_name
(
self
.
root
)
self
.
systemroot
=
self
.
image
.
g
.
inspect_get_windows_systemroot
(
self
.
root
)
self
.
vm
=
VM
(
self
.
image
.
device
,
self
.
sysprep_params
)
self
.
registry
=
Registry
(
self
.
image
.
g
,
self
.
root
)
...
...
@@ -379,9 +381,8 @@ class Windows(OSBase):
firewall_states
=
self
.
registry
.
update_firewalls
(
0
,
0
,
0
)
# Delete the pagefile. It will be recreated when the system boots
systemroot
=
self
.
image
.
g
.
inspect_get_windows_systemroot
(
self
.
root
)
try
:
pagefile
=
"%s/pagefile.sys"
%
systemroot
pagefile
=
"%s/pagefile.sys"
%
self
.
systemroot
self
.
image
.
g
.
rm_rf
(
self
.
image
.
g
.
case_sensitive_path
(
pagefile
))
except
RuntimeError
:
pass
...
...
@@ -579,8 +580,7 @@ class Windows(OSBase):
catalogfile_entry
=
re
.
compile
(
r
'^\s*CatalogFile\s*='
)
driverver_entry
=
re
.
compile
(
r
'^\s*DriverVer\s*='
)
systemroot
=
self
.
image
.
g
.
inspect_get_windows_systemroot
(
self
.
root
)
inf_path
=
self
.
image
.
g
.
case_sensitive_path
(
"%s/inf"
%
systemroot
)
inf_path
=
self
.
image
.
g
.
case_sensitive_path
(
"%s/inf"
%
self
.
systemroot
)
state
=
{}
for
driver
in
VIRTIO
:
...
...
@@ -615,8 +615,7 @@ class Windows(OSBase):
tip-install-a-device-driver-in-a-windows-vm/
"""
systemroot
=
self
.
image
.
g
.
inspect_get_windows_systemroot
(
self
.
root
)
path
=
"%s/system32/drivers"
%
systemroot
path
=
"%s/system32/drivers"
%
self
.
systemroot
try
:
path
=
self
.
image
.
g
.
case_sensitive_path
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment