Skip to content

Commit

Permalink
Generate new initiatorname from scratch (Fixes: oVirt#14)
Browse files Browse the repository at this point in the history
Since the el9 packages don't build an initiatorname by default, we
should not depend/use the file in factory anymore, but just generate the
string ourselves.

Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
  • Loading branch information
dupondje committed Nov 24, 2022
1 parent 257837c commit 074d81a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/imgbased/plugins/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def _generate_iqn(self):
return
log.debug("Description=Generate a random iSCSI initiator IQN name")
suuid = str(uuid.uuid4()).split("-")[-1]
factory_f = File("/usr/share/factory/etc/iscsi/initiatorname.iscsi")
iqn = factory_f.contents.split(":")[0] + ":" + suuid + "\n"
identifier = command.call("iscsi-iname")
iqn = "InitiatorName=" + identifier.contents.split(":")[0] + ":" + suuid + "\n"
File(initiator).write(iqn)

def _copy_files_to_boot(self):
Expand Down

0 comments on commit 074d81a

Please # to comment.