[Patch for Review] Make colon optional while adding iSCSI Initiator Name in Anaconda installer
by Sujith_Pandel@Dell.com
Hi All,
Sincere Apologies for sending this once again. I made a mistake of including mail restriction note while sending the previous mail.
Sorry once again.
This patch modifies the requirement of ":" (colon) to be present compulsorily in iSCSI Initiator name in Anaconda installer while adding an iSCSI Disk.
Currently while adding an iSCSI Initiator name during installation using Anaconda installer, the iSCSI Initiator name should be containing "." (dot) and ":" (colon) in the iSCSI Qualified Name (IQN) format.
(Ex: iqn.2001-04.com.example:diskarrays-sn-a8675309 ) Without both of them the "Start Discovery" button remains greyed out and the user is unable to discover/add iSCSI target.
However, according to RFC 3720 and RFC 3721, the IQN names may contain a colon optionally.
Hence presence of colon in IQN names should not be considered as a mandatory condition while checking the validity of IQN Initiator name.
This can also be applied for EUI format of iSCSI Naming where only dots will be present.
Requesting review and inclusion to git repo.
****************************************************************************************
>From bbbcbb16a5a8979ae8deaa49cbfb594701960c6e Mon Sep 17 00:00:00 2001
From: Sujith Pandel <sujithpshankar(a)gmail.com>
Date: Wed, 7 Jan 2015 05:41:34 -0500
Subject: [PATCH] Make colon optional while adding iSCSI Initiator Name
Signed-off-by: Sujith Pandel <sujithpshankar(a)gmail.com>
---
pyanaconda/ui/gui/spokes/advstorage/iscsi.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
index 90a1444..5d2f286 100644
--- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
+++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
@@ -302,7 +302,8 @@ class ISCSIDialog(GUIObject):
text = widget.get_text()
stripped = text.strip()
- return "." in stripped and ":" in stripped
+ #iSCSI Naming Standards: RFC 3720 and RFC 3721
+ return "." in stripped
def on_discover_field_changed(self, *args):
# Make up a credentials object so we can test if it's valid.
--
1.9.3
****************************************************************************************
Thanks & Regards,
Sujith Pandel
9 years, 4 months
[PATCH] Add error checks to liveimg mount code (#1178703)
by Brian C. Lane
Instead of logging the mount error and falling into the rsync and
failing later catch problems with mounting the images and moving the
mountpoint.
Related: rhbz#1178703
---
pyanaconda/packaging/livepayload.py | 67 ++++++++++++++++++++++++-------------
1 file changed, 44 insertions(+), 23 deletions(-)
diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
index 0a67774..17c1bac 100644
--- a/pyanaconda/packaging/livepayload.py
+++ b/pyanaconda/packaging/livepayload.py
@@ -373,29 +373,50 @@ class LiveImageKSPayload(LiveImagePayload):
raise exn
# If this looks like a tarfile, skip trying to mount it
- if not self.is_tarfile:
- # Mount the image and check to see if it is a LiveOS/*.img
- # style squashfs image. If so, move it to IMAGE_DIR and mount the real
- # root image on INSTALL_TREE
- blivet.util.mount(self.image_path, INSTALL_TREE, fstype="auto", options="ro")
- if os.path.exists(INSTALL_TREE+"/LiveOS"):
- # Find the first .img in the directory and mount that on INSTALL_TREE
- img_files = glob.glob(INSTALL_TREE+"/LiveOS/*.img")
- if img_files:
- img_file = os.path.basename(sorted(img_files)[0])
-
- # move the mount to IMAGE_DIR
- os.makedirs(IMAGE_DIR, 0o755)
- # work around inability to move shared filesystems
- iutil.execWithRedirect("mount",
- ["--make-rprivate", "/"])
- iutil.execWithRedirect("mount",
- ["--move", INSTALL_TREE, IMAGE_DIR])
- blivet.util.mount(IMAGE_DIR+"/LiveOS/"+img_file, INSTALL_TREE,
- fstype="auto", options="ro")
-
- source = iutil.eintr_retry_call(os.statvfs, INSTALL_TREE)
- self.source_size = source.f_frsize * (source.f_blocks - source.f_bfree)
+ if self.is_tarfile:
+ return
+
+ # Mount the image and check to see if it is a LiveOS/*.img
+ # style squashfs image. If so, move it to IMAGE_DIR and mount the real
+ # root image on INSTALL_TREE
+ rc = blivet.util.mount(self.image_path, INSTALL_TREE, fstype="auto", options="ro")
+ if rc != 0:
+ log.error("mount error (%s) with %s", rc, self.image_path)
+ exn = PayloadInstallError("mount error %s" % rc)
+ if errorHandler.cb(exn) == ERROR_RAISE:
+ raise exn
+
+ # Nothing more to mount
+ if not os.path.exists(INSTALL_TREE+"/LiveOS"):
+ return
+
+ # Mount the first .img in the directory on INSTALL_TREE
+ img_files = glob.glob(INSTALL_TREE+"/LiveOS/*.img")
+ if img_files:
+ # move the mount to IMAGE_DIR
+ os.makedirs(IMAGE_DIR, 0o755)
+ # work around inability to move shared filesystems
+ rc = iutil.execWithRedirect("mount",
+ ["--make-rprivate", "/"])
+ if rc == 0:
+ rc = iutil.execWithRedirect("mount",
+ ["--move", INSTALL_TREE, IMAGE_DIR])
+ if rc != 0:
+ log.error("error %s moving mount", rc)
+ exn = PayloadInstallError("mount error %s" % rc)
+ if errorHandler.cb(exn) == ERROR_RAISE:
+ raise exn
+
+ img_file = IMAGE_DIR+"/LiveOS/"+os.path.basename(sorted(img_files)[0])
+ rc = blivet.util.mount(img_file, INSTALL_TREE, fstype="auto", options="ro")
+ if rc != 0:
+ log.error("mount error (%s) with %s", rc, img_file)
+ exn = PayloadInstallError("mount error %s with %s" % (rc, img_file))
+ if errorHandler.cb(exn) == ERROR_RAISE:
+ raise exn
+
+ source = iutil.eintr_retry_call(os.statvfs, INSTALL_TREE)
+ self.source_size = source.f_frsize * (source.f_blocks - source.f_bfree)
def install(self):
""" Install the payload if it is a tar.
--
1.9.3
9 years, 4 months
[PATCH 1/2] Allow specifying pre-defined repos via kickstart with dnf backend (#1177988).
by Chris Lumens
This is the thing where your kickstart can say:
repo --name=updates
and anaconda will figure out that you want to use the repo already defined in
/etc/anaconda.repos.d. It works with yum, so it also need to work with dnf.
---
pyanaconda/packaging/dnfpayload.py | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index 7a91c26..fab258f 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -691,6 +691,16 @@ class DNFPayload(packaging.PackagePayload):
checkmount)
method = self.data.method
+ # Read in all the repos from the installation environment, make a note of which
+ # are enabled, and then disable them all. If the user gave us a method, we want
+ # to use that instead of the default repos.
+ self._base.read_all_repos()
+
+ enabled = []
+ for repo in self._base.repos.iter_enabled():
+ enabled.append(repo.name)
+ repo.disable()
+
if method.method:
try:
self._base.conf.releasever = self._getReleaseVersion(url)
@@ -716,15 +726,19 @@ class DNFPayload(packaging.PackagePayload):
# this preserves the method details while disabling it
method.method = None
self.install_device = None
-
- if not method.method:
- # only when there's no repo set via method use the repos from the
- # install image itself:
- log.info('Loading repositories config on the filesystem.')
- self._base.read_all_repos()
+ else:
+ for (name, repo) in self._base.repos.iteritems():
+ if name in enabled:
+ repo.enable()
for ksrepo in self.data.repo.dataList():
- self._add_repo(ksrepo)
+ # This is a repo we already have a config file in /etc/anaconda.repos.d,
+ # so we just need to enable it here. See the kickstart docs for the repo
+ # command.
+ if not ksrepo.baseurl and not ksrepo.mirrorlist:
+ self._base.repos[ksrepo.name].enable()
+ else:
+ self._add_repo(ksrepo)
ksnames = [r.name for r in self.data.repo.dataList()]
ksnames.append(constants.BASE_REPO_NAME)
--
1.9.3
9 years, 4 months
[Patch for Review] Make colon optional while adding iSCSI Initiator Name in Anaconda installer
by Sujith_Pandel@Dell.com
Dell - Internal Use - Confidential
Hi All,
This patch modifies the requirement of ":" (colon) to be present compulsorily in iSCSI Initiator name in Anaconda installer while adding an iSCSI Disk.
Currently while adding an iSCSI Initiator name during installation using Anaconda installer, the iSCSI Initiator name should be containing "." (dot) and ":" (colon) in the iSCSI Qualified Name (IQN) format.
(Ex: iqn.2001-04.com.example:diskarrays-sn-a8675309 ) Without both of them the "Start Discovery" button remains greyed out and the user is unable to discover/add iSCSI target.
However, according to RFC 3720 and RFC 3721, the IQN names may contain a colon optionally.
Hence presence of colon in IQN names should not be considered as a mandatory condition while checking the validity of IQN Initiator name.
This can also be applied for EUI format of iSCSI Naming where only dots will be present.
Requesting review and inclusion to git repo.
****************************************************************************************
>From bbbcbb16a5a8979ae8deaa49cbfb594701960c6e Mon Sep 17 00:00:00 2001
From: Sujith Pandel <sujithpshankar(a)gmail.com>
Date: Wed, 7 Jan 2015 05:41:34 -0500
Subject: [PATCH] Make colon optional while adding iSCSI Initiator Name
Signed-off-by: Sujith Pandel <sujithpshankar(a)gmail.com>
---
pyanaconda/ui/gui/spokes/advstorage/iscsi.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
index 90a1444..5d2f286 100644
--- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
+++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
@@ -302,7 +302,8 @@ class ISCSIDialog(GUIObject):
text = widget.get_text()
stripped = text.strip()
- return "." in stripped and ":" in stripped
+ #iSCSI Naming Standards: RFC 3720 and RFC 3721
+ return "." in stripped
def on_discover_field_changed(self, *args):
# Make up a credentials object so we can test if it's valid.
--
1.9.3
****************************************************************************************
Thanks & Regards,
Sujith Pandel
9 years, 4 months
[PATCH] Implement DNFPayload.environmentOptionIsDefault (#1179905)
by David Shea
---
pyanaconda/packaging/dnfpayload.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index f8bfdea..3b223d3 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -559,7 +559,10 @@ class DNFPayload(packaging.PackagePayload):
env = self._base.comps.environment_by_pattern(environmentid)
if env is None:
raise packaging.NoSuchGroup(environmentid)
- return False
+
+ # Look a group in the optionlist that matches the group_id and
+ # has default set
+ return any(grp for grp in env.option_ids if grp.name == grpid and grp.default)
def groupDescription(self, grpid):
""" Return name/description tuple for the group specified by id. """
--
2.1.0
9 years, 4 months
[blivet][master,rhel7] Fix 1166509, 1167292
by David Lehman
David Lehman (2):
Don't crash when a free region is too small for an aligned partition.
Use _netdev mount option as needed. (#1166509)
blivet/__init__.py | 1 -
blivet/devices/btrfs.py | 6 ++++--
blivet/devices/partition.py | 5 -----
blivet/devices/storage.py | 20 ++++++++++++++++++++
blivet/partitioning.py | 18 ++++++++++++------
tests/devices_test.py | 30 ++++++++++++++++++++++++++++++
6 files changed, 66 insertions(+), 14 deletions(-)
--
1.9.3
9 years, 4 months
[blivet:master 00/17] Patches about mounting filesystems
by Anne Mulhern
They are all fairly trivial tests or refactoring cleanups until
"Substitute FS.mountopts...".
Because mounting and resizing are a bit mixed up in TmpFS, some
of these patches are about both actions.
I had hoped to put in a satisfactory test about the resizability of TmpFS
while I was at it, but it turned out that I really couldn't.
mulhern (17):
Add a tiny test for TmpFS.
Be less eager about processing all lines in /proc/meminfo.
Simplify setting options variable.
Simplify FS._getOptions().
Tighten up FS.mountable().
Virtualize options property methods in DeviceFormat.options
definition.
Eliminate some redundant definitions of the device property.
Add simple _sizeOption() method to TmpFS class.
Simplify TmpFS.resizeArgs() just a bit.
Substitute FS.mountopts for TmpFS._options instance variable.
Change TmpFS._getOptions() so it always appends _size_option.
Have TmpFS.resizeArgs() use default options if options not set.
Do not bother to set device.format.mountopts.
Set format's mountpoint if it has the mountpoint attribute.
Destrengthen self._size_option field.
Do not redefine size property in TmpFS.
Make TmpFS._resizable False.
blivet/__init__.py | 13 ++----
blivet/formats/__init__.py | 6 ++-
blivet/formats/fs.py | 98 ++++++++++++++-----------------------------
blivet/formats/swap.py | 3 --
blivet/util.py | 7 ++--
tests/formats_test/fs_test.py | 13 ++++++
6 files changed, 56 insertions(+), 84 deletions(-)
--
1.9.3
9 years, 4 months
[PATCH 0/3] Fix dnf environment selection
by David Shea
*** BLURB HERE ***
David Shea (3):
Remove unused methods for deselecting environments
Remove optional groups from environmentGroups
Move environment group selection logic to PackagePayload (#1179362)
pyanaconda/packaging/__init__.py | 7 ++++++-
pyanaconda/packaging/dnfpayload.py | 36 ++----------------------------------
pyanaconda/packaging/yumpayload.py | 30 +-----------------------------
3 files changed, 9 insertions(+), 64 deletions(-)
--
2.1.0
9 years, 4 months
[blivet:master 00/20] Patches related to _resizefsUnit
by Anne Mulhern
This turns out to be actually quite a lot of patches about Sizes.
The first 8 patches are minor fixes for little things that I ran into
while worrying about Sizes.
With "Make _Prefix entries..." I'm starting to try to set things up so that
it is possible to have some kind of values that represent units to pass
to convertTo() and roundToNearest(). By using string specifiers of units
as arguments to these methods, we end up using _parseUnits() to find out
the units. This is kind of a mistake, because it is a method that is
really designed for parsing human input size strings, so it is
unnecessarily heavyweight for a context where the units is precisely known
and specified explicitly in the program.
"Do not even pretend..." patch is a bit of a one off. I really think we can
get rid of that code, about the only thing it is likely ever to do for us
is halt some install sometime (if it is ever run).
Then come three patches about resizeArgs() and _resizefsUnit. The last
two of these may be somewhat controversial. Here's my take on things:
Without the "Use _resizefsUnit in resizeArgs()..." patch a developer has to
have or somehow obtain some knowledge about the connection between
the unit in resizeArgs() and the one in getMinSize(). Let's suppose they
change _resizefsUnit (because they want to change how getMinSize() behaves).
They can:
(1) Fail to realize that they need to change resizeArgs() as well. If they
are lucky, and they changed _resizefsUnit to a multiple of the units in
resizeArgs() there may or not appear to be a problem. If they are unlucky
and they changd _resizefsUnit to something other than a multiple, then
the result of the resize operation will most likely be wrong. That would
be a bug.
(2) Realize that they need to change the units of resizeArgs() correspondingly.
If so, they ought to have the good sense to look at the containing
expression, and infer that they need to change the format string as well.
With the "Use _resizefsUnit in resizeArgs()..." patch a developer does not
need to know any secret lore. Being conscientious, they do a search for the
string _resizefsUnit and find it in resizeArgs(). They know there is a
connection and only possibility (2) from above is available.
My patch eliminates the possibility of bugs arising from situation (1).
I realize it relies on the programmer being able to realize that if the
units of the size change, so should the format string, but I _think_
that's not hard.
Finally, there are two patches about Size.__new__. The motivation
for these two is to avoid running the _parseSpec() method from
Size.__new__() as _parseSpec() is really designed to handle
user-input strings. It is far too general for literals specified in the
program and is correspondingly busy. The locale stuff, the regular
expression matching, iterating through a list dynamically calculating
string specs and comparing them with the string given is huge overkill
when the unit required is already known at compile time.
This approach is less invasive than some others and does not _require_
any change to user code. I think that ideally user input parsing would
be handled in anaconda, since that is not really blivet's job at all, but
I think that would be in the far future, so might as well do this for now.
This approach speeds construction of Size() object up by a factor of 3 or 4,
suprisingly little. But it seems like the more correct thing. If everybody
accepts it, I'll also convert the Size literals in tests subdirectory to
use tuples.
mulhern (20):
Get rid of unnecessary use of long.
Make possiblePhysicalExtents() a bit more direct.
Do not compare the same two values twice.
Do not calculate Sizes unless they are needed.
Avoid using Size constant in FileDevice._create().
Eliminate redundant test.
Comment _prefixTestHelper() and eliminate some redundancies.
Hoist _BINARY_FACTOR * min_value calculation out of loop.
Make _Prefix entries named constants.
Add unitStr() method.
Make _parseUnits() return a unit constant, rather than a number.
Get whole unit tuple in loop when searching for correct units.
Do not even pretend that ReiserFS is resizable.
Change convertTo() and roundToNearest() so each takes a units
specifier.
Use convertTo in humanReadable().
Do not supply a default implementation for the resizeArgs() method.
Use _resizefsUnit in resizeArgs() method implementations.
Add _resizefsUnit to TmpFS and use in appropriate places.
Add a new way of specifying Sizes().
Use tuples to construct Sizes() wherever units are known.
blivet/devicefactory.py | 6 +-
blivet/devicelibs/btrfs.py | 4 +-
blivet/devicelibs/crypto.py | 4 +-
blivet/devicelibs/lvm.py | 45 +++++-----
blivet/devicelibs/mdraid.py | 10 +--
blivet/devicelibs/swap.py | 15 ++--
blivet/devices/file.py | 8 +-
blivet/devices/lvm.py | 16 ++--
blivet/devices/partition.py | 12 +--
blivet/formats/biosboot.py | 6 +-
blivet/formats/fs.py | 77 ++++++++---------
blivet/formats/prepboot.py | 6 +-
blivet/formats/swap.py | 4 +-
blivet/partitioning.py | 6 +-
blivet/platform.py | 22 ++---
blivet/size.py | 168 ++++++++++++++++++++------------------
blivet/udev.py | 12 +--
blivet/util.py | 6 +-
tests/devicelibs_test/lvm_test.py | 5 --
tests/size_test.py | 96 +++++++++++-----------
tests/storagetestcase.py | 4 +-
21 files changed, 261 insertions(+), 271 deletions(-)
--
1.9.3
9 years, 4 months