Yuvipanda has submitted this change and it was merged.

Change subject: base: Use ::hostname instead of ::instancename
......................................................................


base: Use ::hostname instead of ::instancename

Missed these in the earlier commit

Get rid of some of the branching for $INSTANCENAME - that probably dates from
when \h would've given the ec2id, but we can use it here now.

Using the puppet ENC on labtest passes through *no* puppetVars, making
this problem more obvious there.

Bug: T101447
Change-Id: I88097f81f1b9bca7851fbb6e8f52f5cd4721db89
---
M modules/base/templates/environment/bash.bashrc.erb
M modules/base/templates/environment/skel/bashrc.erb
2 files changed, 3 insertions(+), 17 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/modules/base/templates/environment/bash.bashrc.erb 
b/modules/base/templates/environment/bash.bashrc.erb
index cfbd746..ac0fa7c 100644
--- a/modules/base/templates/environment/bash.bashrc.erb
+++ b/modules/base/templates/environment/bash.bashrc.erb
@@ -28,12 +28,10 @@
 
 # set a fancy prompt (non-color, overwrite the one in /etc/profile)
 
-<% if has_variable?("instancename") then %>
-export INSTANCENAME=<%= @instancename %>
-PS1='${debian_chroot:+($debian_chroot)}\u@${INSTANCENAME}:\w\$ '
-<% else %>
-PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
+<% if has_variable?("hostname") then %>
+export INSTANCENAME=<%= @hostname %>
 <% end %>
+PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
 
 <% if has_variable?("labsproject") then %>
 export INSTANCEPROJECT=<%= @labsproject %>
diff --git a/modules/base/templates/environment/skel/bashrc.erb 
b/modules/base/templates/environment/skel/bashrc.erb
index 218c3e5..43f2a66 100644
--- a/modules/base/templates/environment/skel/bashrc.erb
+++ b/modules/base/templates/environment/skel/bashrc.erb
@@ -58,28 +58,16 @@
 fi
 
 if [ "$color_prompt" = yes ]; then
-<% if has_variable?("instancename") then %>
-    PS1='${debian_chroot:+($debian_chroot)}\u@${INSTANCENAME}:\w\$ '
-<% else %>
     
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
 '
-<% end %>
 else
-<% if has_variable?("instancename") then %>
-    PS1='${debian_chroot:+($debian_chroot)}\u@${INSTANCENAME}:\w\$ '
-<% else %>
     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
-<% end %>
 fi
 unset color_prompt force_color_prompt
 
 # If this is an xterm set the title to user@host:dir
 case "$TERM" in
 xterm*|rxvt*)
-<% if has_variable?("instancename") then %>
-    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@${INSTANCENAME}: 
\w\a\]$PS1"
-<% else %>
     PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
-<% end %>
     ;;
 *)
     ;;

-- 
To view, visit https://gerrit.wikimedia.org/r/309215
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I88097f81f1b9bca7851fbb6e8f52f5cd4721db89
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk <a...@wikimedia.org>
Gerrit-Reviewer: Gehel <gleder...@wikimedia.org>
Gerrit-Reviewer: Yuvipanda <yuvipa...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to