Giter VIP home page Giter VIP logo

Comments (1)

degremont avatar degremont commented on August 12, 2024

-L is already implemented as -n $HOSTNAME internally.

This patch should do the trick:

    Ticket #209: support -L flag for 'install' command

    Call init_execute() also for 'install' command like
    all other FSLiveCommand classes.

diff --git a/lib/Shine/Commands/Base/Command.py b/lib/Shine/Commands/Base/Command.py
index 886082b..d4ef640 100644
--- a/lib/Shine/Commands/Base/Command.py
+++ b/lib/Shine/Commands/Base/Command.py
@@ -87,6 +87,19 @@ class Command(object):
         # default is to not filter return code
         return rc

+    def has_local_flag(self):
+        return self.options.local or self.options.remote
+
+    def init_execute(self):
+        """
+        Initialize execution of remote command, if needed. Should be called
+        first from derived classes before really executing the command.
+        """
+        # Limit the scope of the command if called with local flag (-L) or
+        # called remotely (-R).
+        if self.has_local_flag():
+            self.options.nodes = NodeSet(Server.hostname_short())
+
     def iter_fsname(self):

         # If some labels are specified, they also specifies some fs names.
@@ -182,19 +195,6 @@ class RemoteCommand(Command):
         Command.__init__(self, options, args)
         self.eventhandler = None

-    def has_local_flag(self):
-        return self.options.local or self.options.remote
-
-    def init_execute(self):
-        """
-        Initialize execution of remote command, if needed. Should be called
-        first from derived classes before really executing the command.
-        """
-        # Limit the scope of the command if called with local flag (-L) or
-        # called remotely (-R).
-        if self.has_local_flag():
-            self.options.nodes = NodeSet(Server.hostname_short())
-
     def install_eventhandler(self, local_eventhandler, global_eventhandler):
         """
         Select and install the appropriate event handler.
diff --git a/lib/Shine/Commands/Install.py b/lib/Shine/Commands/Install.py
index 5b70ac3..350dc9a 100644
--- a/lib/Shine/Commands/Install.py
+++ b/lib/Shine/Commands/Install.py
@@ -54,6 +54,8 @@ class Install(Command):
             raise CommandHelpException("Lustre model file path"
                                    "(-m <model_file>) argument required.", self)

+        self.init_execute()
+
         eh = FSGlobalEventHandler(self)

         # Use this Shine.FSUtils convenience function.

from shine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.